1 Configurations

#install.packages(c("rtf"), repos = "http://cran.r-project.org")
library(rtf)
#install.packages("parallel")
library(parallel)
#install.packages("data.table")
library(data.table)
#install.packages("ggplot2")
library(ggplot2)
#install.packages("ggpubr")
#devtools::install_github("kassambara/ggpubr")
library(ggpubr)
library(dplyr)
#install.packages("ARTool")
#install.packages("lubridate")
#install.packages("kableExtra")
#install.packages("caret")
library(ARTool)
library(lubridate)
library(kableExtra)
library(caret)
#install.packages("hrbrthemes")
library(hrbrthemes)
#install.packages("modeest")
library(modeest)

# Robust Analysis
#install.packages("WRS2")
library(WRS2)
source("Rallfun-v37.txt");

PathDesign="Design_Sleep3/"
ColPer<-c("cyan3","blue","red", "magenta2");
LabX<-c("YC","YSD","OC","OSD")

SEM_MM<-function(x) sem=sd(x,na.rm = T)/sqrt(length(x))
Mean_MM<-function(x) mean=mean(x,na.rm = T)
Mean_MMtr<-function(x) mean=mean(x,na.rm = T,trim = 0.2)
tmmm<-function(x) tmean(na.omit(x))

bbwtrimbt_vMM<-function(J, K, L, x, tr = 0.2, JKL = J * K*L, con = 0,
 alpha = 0.05, grp =c(1:JKL), nboot = 599, SEED = TRUE, ...)
{
        #
        # Bootstrap-t for omniubs tests associated with
        # all main effects and interactions
        # for a between-by-between-within design.
        #
        #  The R variable x is assumed to contain the raw
        #  data stored in list mode or in a matrix.
        #  If in list mode, x[[1]] contains the data
        #  for the first level for all three factors: levels 1,1,1.
        #  x[[2]] is assumed to contain the data for level 1 of the
        #  first factor and second factor and level 2 of the third: level 1,1,2
        #  x[[K]] is the data for level 1,1,L
        #  x[[L+1]] is the data for level 1,2,1, x[[2K]] is level 1,2,2, etc.
        #
        #  If the data are in a matrix, column 1 is assumed to
        #  correspond to x[[1]], column 2 to x[[2]], etc.
        #
        #  When in list mode x is assumed to have length JK, the total number
        #  groups being tested, but a subset of the data can be analyzed
        #  using grp
        #
  require(parallel)
if(is.data.frame(x))data=as.matrix(x)
        if(is.matrix(x)) {
                y <- list()
                for(j in 1:ncol(x)) y[[j]] <- x[, j]
                x <- y
}

#        conM = con3way(J,K,L)
 p <- J*K*L
if(p>length(x))stop("JKL is less than the Number of groups")
JK=J*K
        v <- matrix(0, p, p)
        data <- list()
xx=list()
        for(j in 1:length(x)) {
                data[[j]] <- x[[grp[j]]]
xx[[j]]=x[[grp[j]]] # save input data
                # Now have the groups in proper order.
                data[[j]] = data[[j]] - mean(data[[j]], tr = tr)
        }
#ilow=0-L
#iup=0
#for(j in 1:JK){
#ilow <- ilow + L
# iup = iup + L
#sel <- c(ilow:iup)
#xx[sel]=listm(elimna(matl(xx[sel])))
# v[sel, sel] <- covmtrim(xx[sel], tr)
#                }
test.stat=bbwtrim(J,K,L,xx,tr=tr)
        x <- data  # Centered data
#        jp <- 1 - K
#        kv <- 0
        if(SEED)
                set.seed(2)
        # set seed of random number generator so that
        #             results can be duplicated.
        testA = NA
        testB = NA
        testC=NA
        testAB = NA
        testAC = NA
        testBC = NA
        testABC = NA
        bsam = list()
        bdat = list()
aboot=NA
bboot=NA
cboot=NA
abboot=NA
acboot=NA
bcboot=NA
abcboot=NA
nvec=NA
       Res<-lapply(1:JK, function(j)
 {
          nvec[j] = length(x[[j]])
          mclapply (1:nboot, function(ib) {
                ilow <- 1 - L; iup = 0
                bsam= unlist(lapply(1:JK, function (j){
                  ilow <- ilow + L; iup = iup + L;nv=length(x[[ilow]])
                  bdat[[j]] = sample(nv, size = nv, replace =TRUE)
                  lapply (ilow:iup, function(k) x[[k]][sample(nv, size = nv, replace =TRUE)])
                }),recursive = F)
          temp=bbwtrim(J,K,L,bsam,tr=tr)
          with(temp, c(Qa,Qb,Qc,Qab,Qac,Qbc,Qabc))
          },
          mc.cores = parallel::detectCores(), mc.allow.recursive = TRUE)
  })

Res2<-as.data.table(unlist(Res, recursive = F))
pbA=NA
pbB=NA
pbC=NA
pbAB=NA
pbAC=NA
pbBC=NA
pbABC=NA
pbA=mean(test.stat$Qa[1,1]<Res2[1,])
pbB=mean(test.stat$Qb[1,1]<Res2[2,])
pbC=mean(test.stat$Qc[1,1]<Res2[3,])
pbAB=mean(test.stat$Qab[1,1]<Res2[3,])
pbAC=mean(test.stat$Qac[1,1]<Res2[3,])
pbBC=mean(test.stat$Qbc[1,1]<Res2[3,])
pbABC=mean(test.stat$Qabc[1,1]<Res2[3,])
list(p.value.A=pbA,p.value.B=pbB,p.value.C=pbC,p.value.AB=pbAB,
p.value.AC=pbAC,p.value.BC=pbBC,p.value.ABC=pbABC)
}

t2waybt_vMM<-function(J,K,x,tr=.2,grp=c(1:p),p=J*K,nboot=599,SEED=TRUE){
#
#   Two-way ANOVA based on trimmed means and a bootstrap-t method
#
#   The data are assumed to be stored as described in the function t2way
#
#   The default number of bootstrap samples is nboot=599
#
require(parallel)
if(is.data.frame(x))x=as.matrix(x)
if(is.matrix(x))x<-listm(x)
if(!is.list(x))stop("Data must be stored in a matrix or in list mode.")
if(SEED)set.seed(2) # set seed of random number generator so that
#             results can be duplicated.
# compute test statistics:
tests=t2way(J=J,K=K,x,tr=tr,grp=grp)
TA=NULL
TB=NULL
TAB=NULL
data=list()
xcen=list()
for(j in 1:length(x))xcen[[j]]<-x[[j]]-mean(x[[j]],tr)
print("Taking bootstrap samples. Please wait.")
Res<-mclapply (1:nboot, function(ib) {
  data<-lapply(1:length(x), function(j) sample(xcen[[j]],size=length(x[[j]]),replace=TRUE))
  bt=t2way(J,K,data,tr=tr,grp=grp)
  with(bt, c(Qa,Qb,Qab))
},mc.cores = parallel::detectCores(), mc.allow.recursive = TRUE)
Res2<-data.table(t(as.data.table(Res)))
pA<-sum(tests$Qa<=Res2$V1)/nboot
pB<-sum(tests$Qb<=Res2$V2)/nboot
pAB<-sum(tests$Qab<=Res2$V3)/nboot
list(A.p.value=pA,B.p.value=pB,AB.p.value=pAB)
}

ExtrSig<-function(DTPas,decim=4) {
    require(data.table)
    DTpp<-copy(DTPas)
    Mx<-as.matrix(round(unlist(DTpp),decim))
    ResP<-data.table(Eff=rownames(Mx),p=Mx);
    ResP[,p.Sig:=""]
    ResP[p.V1<.05,p.Sig:="*    "]
    return(as.data.table(ResP))
   }

ExData.2<-function(nmF,Vars) {
    # For Factorial Bw 2x2
      require(data.table)
    DatDTRes<-list()
    DatDTFullp <- data.table(read.table(nmF, header=TRUE, sep=";", na.strings="NA", dec=",",strip.white=TRUE))
    DatDTp<-DatDTFullp[,Vars,with=F]
    LaVd<-length(DatDTp)
    if (sum(grep("Mouse",names(DatDTp)))>0) {setnames(DatDTp, "Mouse", "Subject"); DatDTp$Subject<-factor(DatDTp$Subject)}
    DatDTp$Age<-factor(DatDTp$Age);DatDTp$Age<-relevel(DatDTp$Age,"Young")
    DatDTp$Sleep<-factor(DatDTp$Sleep);levels(DatDTp$Sleep) <- list("Control"="control", "SR"="restriction")
      setkey(DatDTp,Age,Sleep)
    ArP<-unlist(lapply(1:2, function (x) lapply(1:2, function(y) DatDTp[.(levels(DatDTp$Age)[x],levels(DatDTp$Sleep)[y]),LaVd,with=F][[1]])),recursive = F)
    DatDTRes$DT<-copy(DatDTp)
    DatDTRes$Arp<-ArP
    DatDTRes
}

ExData.2b<-function(nmF,Vars,TypCel) {
    # For Factorial Bw 2x2 & TypeCell
      require(data.table)
    DatDTRes<-list()
    DatDTFullp <- data.table(read.table(nmF, header=TRUE, sep=";", na.strings="NA", dec=",",strip.white=TRUE))
    setkey(DatDTFullp,Type)
    DatDTFullp<-DatDTFullp[TypCel]
    DatDTp<-DatDTFullp[,Vars,with=F]
    LaVd<-length(DatDTp)
    if (sum(grep("Mouse",names(DatDTp)))>0) {setnames(DatDTp, "Mouse", "Subject"); DatDTp$Subject<-factor(DatDTp$Subject)}
    DatDTp$Age<-factor(DatDTp$Age);DatDTp$Age<-relevel(DatDTp$Age,"Young")
    DatDTp$Sleep<-factor(DatDTp$Sleep);levels(DatDTp$Sleep) <- list("Control"="control", "SR"="restriction")
      setkey(DatDTp,Age,Sleep)
    ArP<-unlist(lapply(1:2, function (x) lapply(1:2, function(y) DatDTp[.(levels(DatDTp$Age)[x],levels(DatDTp$Sleep)[y]),LaVd,with=F][[1]])),recursive = F)
    DatDTRes$DT<-copy(DatDTp)
    DatDTRes$Arp<-ArP
    DatDTRes
}

ExDataIS.2<-function(nmF,Vars,vIntP=0,lvlCh) {
    # For trifactorial Mx {Design 2*2*(4*S)} or {Design 2*2*(5*S)}
      require(data.table)
    DatDTRes<-list()
    DatDTFullp <- data.table(read.table(nmF, header=TRUE, sep=";", na.strings="NA", dec=",",strip.white=TRUE))
    DatDTp<-DatDTFullp[,Vars,with=F]
    LaVd<-length(DatDTp)
    if (sum(grep("Mouse",names(DatDTp)))>0) setnames(DatDTp, "Mouse", "Subject")
    if ("fullname" %in% names(DatDTp)) setnames(DatDTp, "fullname", "Subject")
    DatDTp$Age<-factor(DatDTp$Age);DatDTp$Age<-relevel(DatDTp$Age,"Young")
    DatDTp$Sleep<-factor(DatDTp$Sleep);levels(DatDTp$Sleep) <- list("Control"="control", "SR"="restriction")
    DatDTp$Subject<-factor(DatDTp$Subject)
      setkey(DatDTp,Age,Sleep)
    
    
        NmIntra=names(DatDTp[,vIntP,with=F])
        ExtendDTp<-reshape(DatDTp,direction = "long",varying = list(vIntP),idvar = "Subject",timevar=c("Moment"),times=NmIntra)
        LaVd2<-length(ExtendDTp)    
        colnames(ExtendDTp)[LaVd2] <- "DepVar"
        ExtendDTp$Moment<-factor(ExtendDTp$Moment)
        levels(ExtendDTp$Moment) <-(lvlCh)
        ExtendDTp$Age<-factor(ExtendDTp$Age);ExtendDTp$Age<-relevel(ExtendDTp$Age,"Young")
        ExtendDTp$Sleep<-factor(ExtendDTp$Sleep);ExtendDTp$Sleep<-relevel(ExtendDTp$Sleep,"Control")
        ExtendDTp$Inter<-interaction(ExtendDTp$Age,ExtendDTp$Sleep)
        ExtendDTp$Inter<-factor( ExtendDTp$Inter,levels=c("Young.Control", "Young.SR", "Old.Control","Old.SR"))
    
        ArPp<-unlist(unlist(lapply(1:2, function (x) lapply(1:2, function(y) lapply(vIntP, function(z) na.omit(DatDTp[.(levels(DatDTp$Age)[x],levels(DatDTp$Sleep)[y]),z,with=F][[1]])))),recursive = F),recursive = F)
        DatDTRes$DT<-copy(DatDTp)
        DatDTRes$Arp<-copy(ArPp)
        DatDTRes$ExtendDT<-copy(ExtendDTp)
      DatDTRes
}

ExDataIS.2b<-function(nmF,Vars,vIntP=0,lvlCh) {
    # For trifactorial Mx {Design 2*2*(4*S)} of Global Remap All Cells
      require(data.table)
    DatDTRes<-list()
    DatDTFullp <- data.table(read.table(nmF, header=TRUE, sep=";", na.strings="NA", dec=",",strip.white=TRUE))
    DatDTFullp[,Subject:=interaction(Mouse,Cell)]
    DatDTp<-DatDTFullp[,Vars,with=F]
    LaVd<-length(DatDTp)
    if (sum(grep("Mouse",names(DatDTp)))>0) setnames(DatDTp, "Mouse", "Subject")
    DatDTp$Age<-factor(DatDTp$Age);DatDTp$Age<-relevel(DatDTp$Age,"Young")
    DatDTp$Sleep<-factor(DatDTp$Sleep);levels(DatDTp$Sleep) <- list("Control"="control", "SR"="restriction")
    DatDTp$Subject<-factor(DatDTp$Subject)
      setkey(DatDTp,Age,Sleep)
    
    
        NmIntra=names(DatDTp[,vIntP,with=F])
        ExtendDTp<-reshape(DatDTp,direction = "long",varying = list(vIntP),idvar = "Subject",timevar=c("Moment"),times=NmIntra)
        LaVd2<-length(ExtendDTp)    
        colnames(ExtendDTp)[LaVd2] <- "DepVar"
        ExtendDTp$Moment<-factor(ExtendDTp$Moment)
        levels(ExtendDTp$Moment) <-(lvlCh)
        ExtendDTp$Age<-factor(ExtendDTp$Age);ExtendDTp$Age<-relevel(ExtendDTp$Age,"Young")
        ExtendDTp$Sleep<-factor(ExtendDTp$Sleep);ExtendDTp$Sleep<-relevel(ExtendDTp$Sleep,"Control")
        ExtendDTp$Inter<-interaction(ExtendDTp$Age,ExtendDTp$Sleep)
        ExtendDTp$Inter<-factor( ExtendDTp$Inter,levels=c("Young.Control", "Young.SR", "Old.Control","Old.SR"))
    
        ArPp<-unlist(unlist(lapply(1:2, function (x) lapply(1:2, function(y) lapply(vIntP, function(z) na.omit(DatDTp[.(levels(DatDTp$Age)[x],levels(DatDTp$Sleep)[y]),z,with=F][[1]])))),recursive = F),recursive = F)
        DatDTRes$DT<-copy(DatDTp)
        DatDTRes$Arp<-copy(ArPp)
        DatDTRes$ExtendDT<-copy(ExtendDTp)
      DatDTRes
}

ExDataIS.3<-function(nmF,Vars,vIntP=0,lvlCh,TypCel) {
    # For trifactorial Mx {Design 2*2*(4*S)} of Global Remap Context Object or Unstable Cells
    require(data.table)
    DatDTRes<-list()
    DatDTFullp <- data.table(read.table(nmF, header=TRUE, sep=";", na.strings="NA", dec=",",strip.white=TRUE))
    if (!("fullname" %in% names(DatDTFullp))) {DatDTFullp[,Subject:=interaction(Mouse,Cell)]
      }
    if ("fullname" %in% names(DatDTFullp)) setnames(DatDTFullp, "fullname", "Subject")
    setkey(DatDTFullp,Type)
    DatDTFullp<-DatDTFullp[TypCel]
    DatDTp<-DatDTFullp[,Vars,with=F]
    LaVd<-length(DatDTp)
    if (sum(grep("Mouse",names(DatDTp)))>0) setnames(DatDTp, "Mouse", "Subject")
    
    DatDTp$Age<-factor(DatDTp$Age);DatDTp$Age<-relevel(DatDTp$Age,"Young")
    DatDTp$Sleep<-factor(DatDTp$Sleep);levels(DatDTp$Sleep) <- list("Control"="control", "SR"="restriction")
    DatDTp$Subject<-factor(DatDTp$Subject)
      setkey(DatDTp,Age,Sleep)
    
    
        NmIntra=names(DatDTp[,vIntP,with=F])
        ExtendDTp<-reshape(DatDTp,direction = "long",varying = list(vIntP),idvar = "Subject",timevar=c("Moment"),times=NmIntra)
        LaVd2<-length(ExtendDTp)    
        colnames(ExtendDTp)[LaVd2] <- "DepVar"
        ExtendDTp$Moment<-factor(ExtendDTp$Moment)
        levels(ExtendDTp$Moment) <-(lvlCh)
        ExtendDTp$Age<-factor(ExtendDTp$Age);ExtendDTp$Age<-relevel(ExtendDTp$Age,"Young")
        ExtendDTp$Sleep<-factor(ExtendDTp$Sleep);ExtendDTp$Sleep<-relevel(ExtendDTp$Sleep,"Control")
        ExtendDTp$Inter<-interaction(ExtendDTp$Age,ExtendDTp$Sleep)
        ExtendDTp$Inter<-factor( ExtendDTp$Inter,levels=c("Young.Control", "Young.SR", "Old.Control","Old.SR"))
    
        ArPp<-unlist(unlist(lapply(1:2, function (x) lapply(1:2, function(y) lapply(vIntP, function(z) na.omit(DatDTp[.(levels(DatDTp$Age)[x],levels(DatDTp$Sleep)[y]),z,with=F][[1]])))),recursive = F),recursive = F)
        DatDTRes$DT<-copy(DatDTp)
        DatDTRes$Arp<-copy(ArPp)
        DatDTRes$ExtendDT<-copy(ExtendDTp)
      DatDTRes
}

ExDataIS.3b<-function(nmF,Vars,vIntP=0,lvlCh,TypCel) {
    # For bifactorial Mx {Design 2*(4*S)} of Global Remap Context Object or Unstable Cells
    require(data.table)
    DatDTRes<-list()
    DatDTFullp <- data.table(read.table(nmF, header=TRUE, sep=";", na.strings="NA", dec=",",strip.white=TRUE))
    if (!("fullname" %in% names(DatDTFullp))) {DatDTFullp[,Subject:=interaction(Mouse,Cell)]
      }
    if ("fullname" %in% names(DatDTFullp)) setnames(DatDTFullp, "fullname", "Subject")
    DatDTFullp[,Subject:=interaction(Mouse,Cell)]
    setkey(DatDTFullp,Type)
    DatDTFullp<-DatDTFullp[TypCel]
    DatDTp<-DatDTFullp[,Vars,with=F]
    LaVd<-length(DatDTp)
    #if (sum(grep("Mouse",names(DatDTp)))>0) setnames(DatDTp, "Mouse", "Subject")
    #if ("fullname" %in% names(DatDTp)) setnames(DatDTp, "fullname", "Subject")
    DatDTp$Age<-factor(DatDTp$Age);DatDTp$Age<-relevel(DatDTp$Age,"Young")
    DatDTp$Sleep<-factor(DatDTp$Sleep);levels(DatDTp$Sleep) <- list("Control"="control", "SR"="restriction")
    DatDTp$Subject<-factor(DatDTp$Subject)
      setkey(DatDTp,Age,Sleep)
    
    
        NmIntra=names(DatDTp[,vIntP,with=F])
        ExtendDTp<-reshape(DatDTp,direction = "long",varying = list(vIntP),idvar = "Subject",timevar=c("Moment"),times=NmIntra)
        LaVd2<-length(ExtendDTp)    
        colnames(ExtendDTp)[LaVd2] <- "DepVar"
        ExtendDTp$Moment<-factor(ExtendDTp$Moment)
        levels(ExtendDTp$Moment) <-(lvlCh)
        ExtendDTp$Age<-factor(ExtendDTp$Age);ExtendDTp$Age<-relevel(ExtendDTp$Age,"Young")
        ExtendDTp$Sleep<-factor(ExtendDTp$Sleep);ExtendDTp$Sleep<-relevel(ExtendDTp$Sleep,"Control")
        ExtendDTp$Group<-interaction(ExtendDTp$Age,ExtendDTp$Sleep,sep = " ",drop = T)
        #ExtendDTp$Inter<-factor( ExtendDTp$Inter,levels=c("Young.Control", "Young.SR", "Old.Control","Old.SR"))
    
        ArPp<-unlist(lapply(1:2, function (x) lapply(vIntP, function(z) na.omit(DatDTp[.(levels(DatDTp$Age)[x]),z,with=F][[1]]))),recursive = F)
        NmIntra2<-c("Group","Subject",NmIntra)
        DatDTp[,Group:=interaction(DatDTp$Age,DatDTp$Sleep,sep = " ",drop = T)]
        DatDTRes$DT<-copy(DatDTp[,..NmIntra2])
        DatDTRes$Arp<-copy(ArPp)
        NmIntra3<-c("Group","Subject","Moment","DepVar")
        DatDTRes$ExtendDT<-copy(ExtendDTp[,..NmIntra3])
      DatDTRes

      
}

ExDataIS.3c<-function(nmF,Vars,vIntP=0,lvlCh) {
    # For bifactorial Mx {Design 2*(4*S)}
    require(data.table)
    DatDTRes<-list()
    DatDTFullp <- data.table(read.table(nmF, header=TRUE, sep=";", na.strings="NA", dec=",",strip.white=TRUE))
    if (!("fullname" %in% names(DatDTFullp))) {DatDTFullp[,Subject:=interaction(Mouse,Cell)]
      }
    if ("fullname" %in% names(DatDTFullp)) setnames(DatDTFullp, "fullname", "Subject")
    DatDTp<-DatDTFullp[,Vars,with=F]
    LaVd<-length(DatDTp)
    if (sum(grep("Mouse",names(DatDTp)))>0) setnames(DatDTp, "Mouse", "Subject")
    DatDTp$Age<-factor(DatDTp$Age);DatDTp$Age<-relevel(DatDTp$Age,"Young")
    DatDTp$Sleep<-factor(DatDTp$Sleep);levels(DatDTp$Sleep) <- list("Control"="control", "SR"="restriction")
    DatDTp$Subject<-factor(DatDTp$Subject)
      setkey(DatDTp,Age,Sleep)
    
    
        NmIntra=names(DatDTp[,vIntP,with=F])
        ExtendDTp<-reshape(DatDTp,direction = "long",varying = list(vIntP),idvar = "Subject",timevar=c("Moment"),times=NmIntra)
        LaVd2<-length(ExtendDTp)    
        colnames(ExtendDTp)[LaVd2] <- "DepVar"
        ExtendDTp$Moment<-factor(ExtendDTp$Moment)
        levels(ExtendDTp$Moment) <-(lvlCh)
        ExtendDTp$Age<-factor(ExtendDTp$Age);ExtendDTp$Age<-relevel(ExtendDTp$Age,"Young")
        ExtendDTp$Sleep<-factor(ExtendDTp$Sleep);ExtendDTp$Sleep<-relevel(ExtendDTp$Sleep,"Control")
        ExtendDTp$Group<-interaction(ExtendDTp$Age,ExtendDTp$Sleep,sep = " ",drop = T)
        #ExtendDTp$Inter<-factor( ExtendDTp$Inter,levels=c("Young.Control", "Young.SR", "Old.Control","Old.SR"))
    
        ArPp<-unlist(lapply(1:2, function (x) lapply(vIntP, function(z) na.omit(DatDTp[.(levels(DatDTp$Age)[x]),z,with=F][[1]]))),recursive = F)
        NmIntra2<-c("Group","Subject",NmIntra)
        DatDTp[,Group:=interaction(DatDTp$Age,DatDTp$Sleep,sep = " ",drop = T)]
        DatDTRes$DT<-copy(DatDTp[,..NmIntra2])
        DatDTRes$Arp<-copy(ArPp)
        NmIntra3<-c("Group","Subject","Moment","DepVar")
        DatDTRes$ExtendDT<-copy(ExtendDTp[,..NmIntra3])
      DatDTRes

      
}

Grph.1<-function(DatP,Dvp,LblsP=c("Preference for Displaced Object", "B","Object Preference During Test"),ylmP,hLin=F,GrpSel=c(2,4)){
    # For on-way design
    require(ggplot2)
    ColPer2<-ColPer[GrpSel]
    LabX2<-LabX[GrpSel]
    g1<-ggplot2::ggplot(data=DatP, aes(x=Group, y=get(Dvp)))
  gg1<-g1+ scale_fill_manual(values=ColPer2) +
      geom_boxplot(colour=ColPer2, outlier.shape = NA,lwd=1) +
    theme_classic2() + theme(legend.position="bottom", text = element_text(size=28),
                             axis.text.x = element_text(colour = "black"),axis.text.y = element_text(colour = "black")) +
    labs(tag=LblsP[2],y=LblsP[3]) +
    stat_summary(fun=tmmm, geom="point", shape=18,
                 size=4, color=ColPer2) + scale_x_discrete(name="",labels=LabX2) + ylim(ylmP)
  if(hLin) gg1<-gg1+geom_hline(yintercept=0, linetype="dashed", color = "gray30")
  gg1
}

Grph.2<-function(DatP,Dvp,LblsP=c("Preference for Displaced Object", "B","Object Preference During Test"),ylmP,hLin=F){
  # For Factorial Design Bw 2*2 
  require(ggplot2)
    g1<-ggplot2::ggplot(data=DatP, aes(x=Age:Sleep, y=get(Dvp)))
  gg1<-g1+ scale_fill_manual(values=ColPer) +
      geom_boxplot(colour=ColPer, outlier.shape = NA,lwd=1) +
    theme_classic2() + theme(legend.position="bottom", text = element_text(size=28),
                             axis.text.x = element_text(colour = "black"),axis.text.y = element_text(colour = "black")) +
    labs(tag=LblsP[2],y=LblsP[3]) +
    stat_summary(fun=tmmm, geom="point", shape=18,
                 size=4, color=ColPer) + scale_x_discrete(name="",labels=LabX) + ylim(ylmP)
  if(hLin) gg1<-gg1+geom_hline(yintercept=0, linetype="dashed", color = "gray30")
  gg1
  
}

Grph.3<-function(DatP,Dvp,LblsP=c("Preference for Displaced Object", "B","Object Preference During Test"),ylmP,hLin=F,lvIp=4,wMain=F){
  # For trifactorial Mx {Design 2*2*(4*S)} or {Design 2*2*(5*S)}
  require(ggplot2)
    ColPerI<-rep(ColPer,lvIp)
    g1<-ggplot2::ggplot(data=DatP, aes(x=Moment, y=DepVar,fill=factor(Age:Sleep)))
    df3<-DatP[,.(DepVar=tmean(na.omit(DepVar))),by=c("Age","Sleep","Moment")]
    gg1<-g1+ 
      geom_boxplot(colour=ColPerI, outlier.shape = NA,lwd=1) +
    theme_classic2()+
    theme(legend.position="None", text = element_text(size=28),
          axis.text.x = element_text(colour = "black"),axis.text.y = element_text(colour = "black")) +
      labs(tag=LblsP[2],y=LblsP[3],x="") +
    scale_fill_manual(values=c(rep("white",4*lvIp)))+stat_summary(fun=tmmm, geom="point", shape=18,
                 size=4, color=ColPerI,position=position_dodge(width=.75)) + ylim(ylmP) 
  if(hLin) gg1<-gg1+geom_hline(yintercept=0, linetype="dashed", color = "gray30")
    if(wMain) gg1<-gg1+stat_summary(fun=mean, geom="point", shape=13, size=8, color="black", fill="gray30") +
      stat_summary(fun=mean, geom="point", shape=13, size=7, color="black", fill="gray30")
  gg1
}

Grph.3.2Intra<-function(DatP,Dvp,LblsP=c("Preference for Displaced Object", "B","Object Preference During Test"),ylmP,hLin=F,lvIp=4,GrpSel=c(1,3),wMain=F){
  # For trifactorial Mx {Design 2*2*(4*S)} or {Design 2*2*(5*S)}
  require(ggplot2)
    ColPerI<-rep(ColPer[GrpSel],lvIp)
    g1<-ggplot2::ggplot(data=DatP, aes(x=Moment, y=DepVar,fill=factor(Group)))
    df3<-DatP[,.(DepVar=tmean(na.omit(DepVar))),by=c("Group","Moment")]
    gg1<-g1+ 
      geom_boxplot(colour=ColPerI, outlier.shape = NA,lwd=1) +
    theme_classic2()+
    theme(legend.position="None", text = element_text(size=28),
          axis.text.x = element_text(colour = "black"),axis.text.y = element_text(colour = "black")) +
      labs(tag=LblsP[2],y=LblsP[3],x="") +
    scale_fill_manual(values=c(rep("white",4*lvIp)))+stat_summary(fun=tmmm, geom="point", shape=18,
                 size=4, color=ColPerI,position=position_dodge(width=.75)) + ylim(ylmP) 
  if(hLin) gg1<-gg1+geom_hline(yintercept=0, linetype="dashed", color = "gray30")
    if(wMain) gg1<-gg1+stat_summary(fun=mean, geom="point", shape=13, size=8, color="black", fill="gray30") +
      stat_summary(fun=mean, geom="point", shape=13, size=7, color="black", fill="gray30")
  gg1
}

Grph.3b<-function(DatP,Dvp,LblsP=c("Preference for Displaced Object", "B","Object Preference During Test"),ylmP,hLin=F,lvIp=4,GrpSel=c(2,4),wMain=F){
  # For bifactorial Mx {Design 2*(4*S)} or {Design 2*(5*S)}
  require(ggplot2)
    ColPerI<-rep(ColPer[GrpSel],lvIp)
    g1<-ggplot2::ggplot(data=DatP, aes(x=Moment, y=DepVar,fill=factor(Group)))
    df3<-DatP[,.(DepVar=tmean(na.omit(DepVar))),by=c("Group","Moment")]
    gg1<-g1+ 
      geom_boxplot(colour=ColPerI, outlier.shape = NA,lwd=1) +
    theme_classic2()+
    theme(legend.position="None", text = element_text(size=28),
          axis.text.x = element_text(colour = "black"),axis.text.y = element_text(colour = "black")) +
      labs(tag=LblsP[2],y=LblsP[3],x="") +
    scale_fill_manual(values=c(rep("white",4*lvIp)))+stat_summary(fun=tmmm, geom="point", shape=18,
                 size=4, color=ColPerI,position=position_dodge(width=.75)) + ylim(ylmP)
  if(hLin) gg1<-gg1+geom_hline(yintercept=0, linetype="dashed", color = "gray30")
    if(wMain) gg1<-gg1+stat_summary(fun=mean, geom="point", shape=13, size=8, color="black", fill="gray30") +
      stat_summary(fun=mean, geom="point", shape=13, size=7, color="black", fill="gray30")
  gg1
}

Grph.3c<-function(DatP,Dvp,LblsP=c("Preference for Displaced Object", "B","Object Preference During Test"),ylmP,hLin=F,lvIp=4,wMain=F){
  # For trifactorial Bw {Design 2*2*2} for Implant, center on Implant
  require(ggplot2)
    ColPerI<-rep(ColPer[1:lvIp],4)
    #ColPerI<-c("aquamarine","mediumaquamarine","cyan3","deepskyblue","darkblue","blue","lightsalmon","maroon","red","pink","purple","magenta2")
    g1<-ggplot2::ggplot(data=DatP, aes(x=Age:Sleep, y=DepVar,fill=factor(Implant)))
    df3<-DatP[,.(DepVar=tmean(na.omit(DepVar))),by=c("Age","Sleep","Implant")]
    gg1<-g1+ 
      geom_boxplot(colour=ColPerI, outlier.shape = NA,lwd=1) +
    theme_classic2()+
    theme(legend.position="None", text = element_text(size=28),
          axis.text.x = element_text(colour = "black"),axis.text.y = element_text(colour = "black")) +
      labs(tag=LblsP[2],y=LblsP[3],x="") + scale_x_discrete(labels=c("YC", "YSR", "OC","OSR")) +
    scale_fill_manual(values=c(rep("white",4*lvIp)))+stat_summary(fun=tmmm, geom="point", shape=18,
                 size=4, color=ColPerI,position=position_dodge(width=.75)) + ylim(ylmP) 
  if(hLin) gg1<-gg1+geom_hline(yintercept=0, linetype="dashed", color = "gray30")
    if(wMain) gg1<-gg1+stat_summary(fun=mean, geom="point", shape=13, size=8, color="black", fill="gray30") +
      stat_summary(fun=mean, geom="point", shape=13, size=7, color="black", fill="gray30")
  gg1
}

Grph.3d<-function(DatP,Dvp,LblsP=c("Preference for Displaced Object", "B","Object Preference During Test"),ylmP,hLin=F,lvIp=4,wMain=F){
  # For trifactorial Bw {Design 2*2*2} For Implant, center on Interaction
  require(ggplot2)
    ColPerI<-rep(ColPer,lvIp)
    g1<-ggplot2::ggplot(data=DatP, aes(x=Implant, y=DepVar,fill=factor(Age:Sleep)))
    df3<-DatP[,.(DepVar=tmean(na.omit(DepVar))),by=c("Age","Sleep","Implant")]
    gg1<-g1+ 
      geom_boxplot(colour=ColPerI, outlier.shape = NA,lwd=1) +
    theme_classic2()+
    theme(legend.position="None", text = element_text(size=28),
          axis.text.x = element_text(colour = "black"),axis.text.y = element_text(colour = "black")) +
      labs(tag=LblsP[2],y=LblsP[3],x="") +
    scale_fill_manual(values=c(rep("white",4*lvIp)))+stat_summary(fun=tmmm, geom="point", shape=18,
                 size=4, color=ColPerI,position=position_dodge(width=.75)) + ylim(ylmP) 
  if(hLin) gg1<-gg1+geom_hline(yintercept=0, linetype="dashed", color = "gray30")
    if(wMain) gg1<-gg1+stat_summary(fun=mean, geom="point", shape=13, size=8, color="black", fill="gray30") +
      stat_summary(fun=mean, geom="point", shape=13, size=7, color="black", fill="gray30")
  gg1
}

Grph.3.Otros<-function(ExtendDTp,LblsP=c("Preference for Displaced Object", "B","Object Preference During Test")) {
  df2<-ExtendDTp[,.(DepVar=Mean_MM(DepVar),sem=SEM_MM(DepVar)),by=c("Age", "Sleep","Moment")]
  g1<-ggplot2::ggplot(data=ExtendDTp, aes(x=Moment, y=DepVar, fill=factor(Age:Sleep)))
  g2<-ggplot2::ggplot(df2, aes(x=Moment, y=DepVar, fill=Age:Sleep)) 
  
  ggg<-list()  
  ggg$BP<-g1+
      geom_boxplot() +
    scale_fill_manual(values=c("gray30", "gray64", "dodgerblue","dodgerblue3"),name="Age * Sleep:",
                         breaks=c("Young:Control","Young:SR","Old:Control", "Old:SR"),
                         labels=c("Young Control", "Young SR","Old Control", "Old SR")) +
    scale_colour_manual(values=c("gray30", "gray64", "dodgerblue3","blue3")) +
    theme_classic2() + theme(legend.position="bottom") + labs(title = LblsP[1], tag=LblsP[2],y=LblsP[3])
    
  ggg$Bars<-g2+
    geom_bar(stat="identity", color="black", 
           position=position_dodge()) +
    geom_errorbar(aes(ymin=DepVar-sem, ymax=DepVar+sem), width=.2,
                 position=position_dodge(.9)) +
    scale_fill_manual(values=c("gray30", "gray64", "dodgerblue","dodgerblue3"),name="Age * Sleep:",
                         breaks=c("Young:Control","Young:SR","Old:Control", "Old:SR"),
                         labels=c("Young Control", "Young SR","Old Control", "Old SR")) +
    scale_colour_manual(values=c("gray30", "gray64", "dodgerblue3","blue3")) +
    theme_classic2() + theme(legend.position="bottom") + labs(title = LblsP[1], tag=LblsP[2],y=LblsP[3])

   # Marginals
  #AB
  df3<-ExtendDTp[,.(DepVar=Mean_MM(DepVar),sem=SEM_MM(DepVar)),by=c("Age", "Sleep")]  
  g3<-ggplot2::ggplot(df3, aes(x=Age, y=DepVar, fill=Sleep)) 
  
  ggg$MargAB<-g3+
    geom_bar(stat="identity", color="black", 
           position=position_dodge()) +
    geom_errorbar(aes(ymin=DepVar-sem, ymax=DepVar+sem), width=.2,
                 position=position_dodge(.9)) +
    scale_fill_manual(values=c("gray30", "gray64", "dodgerblue","dodgerblue3"),name="Sleep:") +
    scale_colour_manual(values=c("gray30", "gray64", "dodgerblue3","blue3")) +
    theme_classic2() + theme(legend.position="bottom") + labs(title = LblsP[1], tag=LblsP[2],y=LblsP[3])
  
  #AC
  df4<-ExtendDTp[,.(DepVar=Mean_MM(DepVar),sem=SEM_MM(DepVar)),by=c("Age", "Moment")]  
  g4<-ggplot2::ggplot(df4, aes(x=Moment, y=DepVar, fill=Age)) 
  
  ggg$MargAC<-g4+
    geom_bar(stat="identity", color="black", 
           position=position_dodge()) +
    geom_errorbar(aes(ymin=DepVar-sem, ymax=DepVar+sem), width=.2,
                 position=position_dodge(.9)) +
    scale_fill_manual(values=c("gray30", "gray64", "dodgerblue","dodgerblue3"),name="Age:") +
    scale_colour_manual(values=c("gray30", "gray64", "dodgerblue3","blue3")) +
    theme_classic2() + theme(legend.position="bottom") + labs(title = LblsP[1], tag=LblsP[2],y=LblsP[3])
  
  #BC
  df5<-ExtendDTp[,.(DepVar=Mean_MM(DepVar),sem=SEM_MM(DepVar)),by=c("Sleep", "Moment")]  
  g5<-ggplot2::ggplot(df5, aes(x=Moment, y=DepVar, fill=Sleep)) 
  
  ggg$MargBC<-g5+
    geom_bar(stat="identity", color="black", 
           position=position_dodge()) +
    geom_errorbar(aes(ymin=DepVar-sem, ymax=DepVar+sem), width=.2,
                 position=position_dodge(.9)) +
    scale_fill_manual(values=c("gray30", "gray64", "dodgerblue","dodgerblue3"),name="Sleep:") +
    scale_colour_manual(values=c("gray30", "gray64", "dodgerblue3","blue3")) +
    theme_classic2() + theme(legend.position="bottom") + labs(title = LblsP[1], tag=LblsP[2],y=LblsP[3])
  
  #C
  df2.b<-ExtendDTp[,.(DepVar=Mean_MM(DepVar),sem=SEM_MM(DepVar)),by=c("Moment")]
  g1.b<-ggplot2::ggplot(data=df2.b, aes(x=Moment, y=DepVar))
  ggg$MargC<-g1.b+
    geom_bar(stat="identity", color="black", 
           position=position_dodge()) +
    geom_errorbar(aes(ymin=DepVar-sem, ymax=DepVar+sem), width=.2,
                 position=position_dodge(.9)) +
    scale_fill_manual(values=c("gray30", "gray64", "dodgerblue","dodgerblue3"),name="Group") +
    scale_colour_manual(values=c("gray30", "gray64", "dodgerblue","dodgerblue3")) +
    theme_classic2() + theme(legend.position="bottom") + labs(title = LblsP[1], tag=LblsP[2],y=LblsP[3])
  
  return(ggg)
}

Grph.3.Otrosb<-function(ExtendDTp,LblsP=c("Preference for Displaced Object", "B","Object Preference During Test")) {
  df2<-ExtendDTp[,.(DepVar=Mean_MM(DepVar),sem=SEM_MM(DepVar)),by=c("Age", "Moment")]
  g1<-ggplot2::ggplot(data=ExtendDTp, aes(x=Moment, y=DepVar, fill=factor(Age)))
  g2<-ggplot2::ggplot(df2, aes(x=Moment, y=DepVar, fill=Age)) 
  
  ggg<-list()  
  ggg$BP<-g1+
      geom_boxplot() +
    scale_fill_manual(values=c("gray30", "gray64", "dodgerblue","dodgerblue3"),name="Age * Sleep:",
                         breaks=c("Young:Control","Young:SR","Old:Control", "Old:SR"),
                         labels=c("Young Control", "Young SR","Old Control", "Old SR")) +
    scale_colour_manual(values=c("gray30", "gray64", "dodgerblue3","blue3")) +
    theme_classic2() + theme(legend.position="bottom") + labs(title = LblsP[1], tag=LblsP[2],y=LblsP[3])
    
  ggg$Bars<-g2+
    geom_bar(stat="identity", color="black", 
           position=position_dodge()) +
    geom_errorbar(aes(ymin=DepVar-sem, ymax=DepVar+sem), width=.2,
                 position=position_dodge(.9)) +
    scale_fill_manual(values=c("gray30", "gray64", "dodgerblue","dodgerblue3"),name="Age * Sleep:",
                         breaks=c("Young:Control","Young:SR","Old:Control", "Old:SR"),
                         labels=c("Young Control", "Young SR","Old Control", "Old SR")) +
    scale_colour_manual(values=c("gray30", "gray64", "dodgerblue3","blue3")) +
    theme_classic2() + theme(legend.position="bottom") + labs(title = LblsP[1], tag=LblsP[2],y=LblsP[3])

   # Marginals
  #AC
  df4<-ExtendDTp[,.(DepVar=Mean_MM(DepVar),sem=SEM_MM(DepVar)),by=c("Age","Moment")]  
  g4<-ggplot2::ggplot(df4, aes(x=Moment, y=DepVar, fill=Age)) 
  
  ggg$MargAC<-g4+
    geom_bar(stat="identity", color="black", 
           position=position_dodge()) +
    geom_errorbar(aes(ymin=DepVar-sem, ymax=DepVar+sem), width=.2,
                 position=position_dodge(.9)) +
    scale_fill_manual(values=c("gray30", "gray64", "dodgerblue","dodgerblue3"),name="Age:") +
    scale_colour_manual(values=c("gray30", "gray64", "dodgerblue3","blue3")) +
    theme_classic2() + theme(legend.position="bottom") + labs(title = LblsP[1], tag=LblsP[2],y=LblsP[3])
  
  
  #C
  df2.b<-ExtendDTp[,.(DepVar=Mean_MM(DepVar),sem=SEM_MM(DepVar)),by=c("Moment")]
  g1.b<-ggplot2::ggplot(data=df2.b, aes(x=Moment, y=DepVar))
  ggg$MargC<-g1.b+
    geom_bar(stat="identity", color="black", 
           position=position_dodge()) +
    geom_errorbar(aes(ymin=DepVar-sem, ymax=DepVar+sem), width=.2,
                 position=position_dodge(.9)) +
    scale_fill_manual(values=c("gray30", "gray64", "dodgerblue","dodgerblue3"),name="Age") +
    scale_colour_manual(values=c("gray30", "gray64", "dodgerblue","dodgerblue3")) +
    theme_classic2() + theme(legend.position="bottom") + labs(title = LblsP[1], tag=LblsP[2],y=LblsP[3])
  
  return(ggg)
}
  
NCPosH<-function(nLA,nLB){
      nL=nLA*nLB
      NCPosH<-matrix(NA,(nL*(nL-1))/2,8)
      NCombi<-matrix(NA,nL,2)
      cnt<-0
      for (i in (1:nLA)) for (j in (1:nLB)) NCombi[cnt<-cnt+1,1:2]<-c(i,j)
      cnt<-0
      for (i in (1:(nL-1))) for (j in ((i+1):(nL))) {
        NCPosH[cnt<-cnt+1,1:2]<-c(i,j)
        NCPosH[cnt,3:6]<-c(NCombi[i,],NCombi[j,])
        NCPosH[cnt,7:8]<-0
        if (NCPosH[cnt,3]==NCPosH[cnt,5]) NCPosH[cnt,7]<-1
        if (NCPosH[cnt,4]==NCPosH[cnt,6]) NCPosH[cnt,8]<-1
        }
      return(NCPosH)
    }
    
ContCAll<-function(A=1,B=1,C=2,Typ="Succ",CnSel=0) {
      require(data.table)
      conCRes<-matrix(0,nrow=A*B*C,ncol=1)
      if (Typ=="Succ") {
        conCRes<-matrix(0,nrow=A*B*C,ncol=C-1)
        for (j in 0:(A*B-1)) for (i in 1:(C-1)) conCRes[c(C*j+i,C*j+i+1),i]<-c(1,-1);
      }
      if (Typ=="Succ.EfS") {
        conCRes<-matrix(0,nrow=A*B*C,ncol=(C-1)*A*B)
        cnt<-0
        for (i in 1:(C-1)) for (j in 0:(A*B-1)) conCRes[c(C*j+i,C*j+i+1),cnt<-cnt+1]<-c(1,-1);
      }
      if (Typ=="Succ.AC") {
        conCRes<-matrix(0,nrow=A*B*C,ncol=(C-1)*A)
          cnt<-0
                for (i in 1:(C-1)) {
                  for (k in 0:(A-1)) {
                    cnt<-cnt+1
                    for (j in 0:(B-1)) {
                    conCRes[c((k*C*B)+(C*j+i),(k*C*B)+(C*j+i+1)),cnt]<-c(1,-1);
                  }
                }
              }
        
      }
      if (Typ=="Succ.BC") {
        conCRes<-matrix(0,nrow=A*B*C,ncol=(C-1)*B)
          cnt<-0
                for (i in 1:(C-1)) {
                  for (k in 0:(B-1)) {
                    cnt<-cnt+1
                    for (j in 0:(A-1)) {
                    conCRes[c((j*C*B)+(C*k+i),(j*C*B)+(C*k+i+1)),cnt]<-c(1,-1);
                  }
                }
              }
        
      }
      if (Typ=="PosHoc") {
        nContr=(C*(C-1))/2
        conCRes<-matrix(0,nrow=A*B*C,ncol=nContr)
        for (k in 0:(A*B-1)) {
          cont=0;
            for (i in (1:(C-1))) {
              for (j in ((i+1):(C))) {
              cont=cont+1
              conCRes[c(C*k+i,C*k+j),cont]=c(1,-1)
              }
            }
          }
      }
      if (Typ=="PosHoc.AB"|Typ=="Desgl.AB") {
        nCon<-A*B
        nContr=(nCon*(nCon-1))/2
        conCRes<-matrix(0,nrow=A*B*C,ncol=nContr)
        
          cont=0;
            for (i in (1:(nCon-1))) {
              for (j in ((i+1):(nCon))) {
                cont=cont+1
                for (k in 0:(C-1)) {
                conCRes[c(C*(i-1)+k+1,C*(j-1)+k+1),cont]=c(1,-1)
              }
            }
          }
      }
      if (Typ=="Desgl.AB") {
        aa<-data.frame(NCPosH(2,2))
        Selaa<-c(which(aa[7]==1),which(aa[8]==1))
        if (sum(CnSel)>0) Selaa<-c(Selaa, which(aa[1]==CnSel[1]&aa[2]==CnSel[2]))
        conCRes=conCRes[,c(Selaa)]
      }
      if (Typ=="AenC") {
        nContr=((A*(A-1))/2)*C
        conCRes<-matrix(0,nrow=A*B*C,ncol=nContr)
        #k=0;h=0
          for (l in 0:(B-1)) {
            cont=0;
            for (i in (1:(A-1))) { 
              for (j in ((i+1):(A))){ 
                
                for (k in 0:(C-1)) {
                  cont=cont+1
                  
                conCRes[c((C*B)*(i-1)+k+(l*C)+1,(C*B)*(j-1)+k+(l*C)+1),cont]=c(1,-1)
                }
              }
            }
          }
      }
      
      if (Typ=="BenC") {
        nContr=((B*(B-1))/2)*C
        conCRes<-matrix(0,nrow=A*B*C,ncol=nContr)
        #k=0;h=0
          for (l in 0:(A-1)) {
            cont=0;
            for (i in (1:(B-1))) { 
              for (j in ((i+1):(B))){
                for (k in 0:(C-1)) {
                  cont=cont+1
                  conCRes[c(C*(i-1)+k+(l*C*A)+1,C*(j-1)+k+(l*C*A)+1),cont]=c(1,-1)
                }
              }
            }
          }
        }
       # A=2;B=2;C=4
       if (Typ=="PosHoc.ABenC"|Typ=="Desgl.ABenC") {
        nCon<-A*B
        nContr=((nCon*(nCon-1))/2)*C
        conCRes<-matrix(0,nrow=A*B*C,ncol=nContr)
        
          cont=0;
           for (k in 0:(C-1)) {
            for (i in (1:(nCon-1))) {
              for (j in ((i+1):(nCon))) {
                cont=cont+1
                conCRes[c(C*(i-1)+k+1,C*(j-1)+k+1),cont]=c(1,-1)
              }
            }
            }
       }
      
       if (Typ=="Desgl.ABenC") {
        aa<-NCPosH(2,2)
        aaR <- data.table(aa[rep(seq_len(nrow(aa)), C),],V9=c(rep(c(1:C),each=nrow(aa))))
        #aaR<-aaR[order(-V7,-V8)]
        Res1<-lapply (1:C, function(x) c(
          which(aaR[,7]==1 & aaR[,9]==x),
          which(aaR[,8]==1 & aaR[,9]==x))
          )
        Selaa<-unlist(Res1)
        aaR[Selaa,]
        if (sum(CnSel)>0) Selaa<-c(Selaa, which(aa[1]==CnSel[1]&aa[2]==CnSel[2]))
        conCRes=conCRes[,c(Selaa)]
       }
      
       if (Typ=="PosHoc.CenB") {
        nContr=((C*(C-1))/2)
        conCRes<-matrix(0,nrow=A*B*C,ncol=nContr)
        #k=0;h=0;l=1
          for (l in 0:(B-1)) {
            cont=0;
            for (i in (1:(C-1))) { 
              for (j in ((i+1):(C))){
                  cont=cont+1
                  conCRes[c(C*l+i,C*l+j),cont]=c(1,-1)
              }
            }
          }
        }
      
      return(conCRes)
    }


  AOVSingle<-function(ArpP,Prc=2) {
    # Robust AOV for 2-levels one-way design
    # yuenv2, bdm
    RestTestRob<-yuenv2(ArpP[[1]],ArpP[[2]])
    RestTestRk1<-bdm(ArpP)
    ResRoRes<-list()
    ResRoRes$t<-with (RestTestRob, paste0("Diff = ",round(dif,Prc),", V(",round(df,Prc),") = ",
    round(teststat,Prc),", Eff.Size = ",round(Effect.Size,Prc), ", p = ",round(p.value,4)))
    
    ResRoRes$tRk1<-with (RestTestRk1, paste0("Diff = ",round(RestTestRob$dif,Prc),", Fw(",
    round(nu1,Prc),",",round(nu2,Prc),") = ",round(F,Prc),", Eff.Size = ",
    round(RestTestRob$Effect.Size,Prc), ", p = ",round(p.value,4)))
    
    ResRoRes$t.2<- with (RestTestRob, as.data.table(cbind(round(dif,Prc), round(df,Prc),
     round(teststat,Prc), round(Effect.Size,Prc), round(p.value,4))))
     
    ResRoRes$tRk2<-with (RestTestRk1, as.data.table(cbind(
    round(RestTestRob$dif,Prc), round(nu1,Prc),
    round(nu2,Prc),round(F,Prc), round(RestTestRob$Effect.Size,Prc), 
    round(p.value,4))))
    
    names(ResRoRes$t.2)<-c("Diff","DF","FW", "Ef.Size", "p")
    names(ResRoRes$tRk2)<-c("Diff","DF1","DF2","Fw","Ef.Size", "p")
  
    return(ResRoRes)
    }
  
  AOVBwF<-function(A=2,B=2,DatPas,nBMM=10000,Prc=2) {
  # Omnibus design {2*2}
  # t2way & rimul, t2waybt, t2waybt_vMM, bdm2way, ESmainMCP, esImcp
  # ContAB2x2 vs ContAB2x2.Ext, lincon, yuen, t1waybt, 
    ExFin<-list()
  ResRo<-list()
  RsRb<-t2way(A,B,DatPas[[2]])

  ResRo$w<- c(RsRb$A.p.value, RsRb$B.p.value, RsRb$AB.p.value)
  ResRo$r<- rimul(A,B,DatPas[[2]],plotit = F)
  ResRo$BT<-c(t2waybt(A,B,DatPas[[2]]))
  APA.N1<-c(round(unlist(RsRb),4),round(unlist(ResRo$BT),4))
  rr<-ExtrSig(ResRo$BT)
  print(rr)
    
  ResRo$BT_MM<-c(t2waybt_vMM(A,B,DatPas[[2]],nboot = nBMM))
  ResRo$Rk1<- bdm2way(A,B,DatPas[[2]])
  rr2=ExtrSig(ResRo$BT_MM)
  print(rr2)
  
  # Approximation to estimate Effect Size  
  TamA=round(mean(ESmainMCP(A,B,DatPas[[2]])$Factor.A[,3]),Prc)
    TamB=round(mean(ESmainMCP(A,B,DatPas[[2]])$Factor.B[,3]),Prc)
    TamInt=round(mean(esImcp(A,B,DatPas[[2]])$Effect.Sizes),Prc)
    
  ExRsRbQ<-with(RsRb, round(c(Qa, Qb, Qab),Prc))
  ExRsRbp<-with(RsRb, round(c(A.p.value, B.p.value,AB.p.value),4))
  ExRsRb.QRMul<-copy(ExRsRbQ); ExRsRb.QRMul[3]<-round(ResRo$r$test[5],Prc);
  ExRsRb.pRMul<-copy(ExRsRbp); ExRsRb.pRMul[3]<-round(ResRo$r$test[8],Prc);
  ExRsRbF.Rk1<-with(ResRo$Rk1, round(c(A.F,B.F,AB.F),Prc));
  ExRsRbp.Rk1<-with(ResRo$Rk1, round(c(p.valueA, p.valueB, p.valueAB),4));
  ExFin$AOV<-data.table(ExRsRbQ,ExRsRbp,ExRsRb.QRMul, ExRsRb.pRMul, ExRsRbF.Rk1, ExRsRbp.Rk1, rr$p.V1,rr$p.Sig,rr2$p.V1,rr2$p.Sig)
  names(ExFin$AOV)<-c("Q","p","Q.RMul","p.RMul", "F.Rk1", "p.Rk1", "pBoot","Sig","pBootMas","SigMas")
  ExFin$AOV<-data.table(Names=c("Age","Sleep","Age*Sleep"),ExFin$AOV)
  ExFin$AOV[,EffSize:=c(TamA,TamB,TamInt)]
    
  #Interaction AB
  # A on each B & B on each A
  cnMM<-ContCAll(A=2,B=2,C=1,"Desgl.AB") #ContAB2x2 
  Contr.1<-lincon(DatPas[[2]],con=cnMM)
  ConEntre.b1<-round(as.data.table(cbind(Contr.1$test,Contr.1$psihat)),Prc)[,.(psihat,df,test,p.value)]
  ConEntre.b1$p.value <-round(Contr.1$psihat[,5],4)

  # Approximation to estimate Effect Size 
  AExtrP<-c("test","p.value","Effect.Size")
  EffA<-parallel::mclapply(1:A, function(x) WRS2::yuen(DepV~Sleep,data=DatPas[[1]][Age==levels(Age)[x]])[6],
                           mc.cores = parallel::detectCores(), mc.allow.recursive = TRUE)
  EffB<-parallel::mclapply(1:B, function(x) WRS2::yuen(DepV~Age,data=DatPas[[1]][Sleep==levels(Sleep)[x]])[6], 
                           mc.cores = parallel::detectCores(), mc.allow.recursive = TRUE)
  EffAb<-parallel::mclapply(1:A, function(x) WRS2::t1waybt(DepV~Sleep,data=DatPas[[1]][Age==levels(Age)[x]],nboot = 900)[AExtrP],
                           mc.cores = parallel::detectCores(), mc.allow.recursive = TRUE)
  EffBb<-parallel::mclapply(1:B, function(x) WRS2::t1waybt(DepV~Age,data=DatPas[[1]][Sleep==levels(Sleep)[x]],nboot = 900)[AExtrP],
                          mc.cores = parallel::detectCores(), mc.allow.recursive = TRUE)
  
  ConEntre.b2<-round(data.table(c(unlist(EffA),unlist(EffB))),Prc)
  ContrBooth1<-rbind(do.call(rbind, lapply(EffAb, as.data.table)),
do.call(rbind, lapply(EffBb, as.data.table)))
  ContrBooth<-round(ContrBooth1,Prc)
  ContrBooth$p.value<-round(ContrBooth1$p.value,4)
  
  names(ContrBooth)<-c("Test.Boot","p.Boot","EffSize.Boot")
  ConEntre.b3<-data.table(Contr=c("Sleep on Young", "Sleep on Old", "Age on Control", "Age on SR"),ConEntre.b1,EfSize=ConEntre.b2,ContrBooth)     
   ExFin$Detall<-ConEntre.b3
   
   #Extents Interaction AB
    ConEntre.b3<-0
      cnMM<-ContCAll(A=2,B=2,C=1,"Desgl.AB",CnSel<-c(2,3)) #ContAB2x2.Ext 
    Contr.1<-lincon(DatPas[[2]],con=cnMM)
    ConEntre.b1<-round(as.data.table(cbind(Contr.1$test,Contr.1$psihat)),Prc)[,.(psihat,df,test,p.value)]
    ConEntre.b1$p.value <-round(Contr.1$psihat[,5],4)
    
    # Approximation to estimate Effect Size
    DatSel<-DatPas[[1]][Sleep=="SR"&Age=="Young"|Sleep=="Control"&Age=="Old"]
    AExtrP<-c("test","p.value","Effect.Size")
  EffA<-parallel::mclapply(1:A, function(x) WRS2::yuen(DepV~Sleep,data=DatPas[[1]][Age==levels(Age)[x]])[6],
                           mc.cores = parallel::detectCores(), mc.allow.recursive = TRUE)
  EffB<-parallel::mclapply(1:B, function(x) WRS2::yuen(DepV~Age,data=DatPas[[1]][Sleep==levels(Sleep)[x]])[6], 
                           mc.cores = parallel::detectCores(), mc.allow.recursive = TRUE)
  EffAb<-parallel::mclapply(1:A, function(x) WRS2::t1waybt(DepV~Sleep,data=DatPas[[1]][Age==levels(Age)[x]],nboot = 900)[AExtrP],
                           mc.cores = parallel::detectCores(), mc.allow.recursive = TRUE)
  EffBb<-parallel::mclapply(1:B, function(x) WRS2::t1waybt(DepV~Age,data=DatPas[[1]][Sleep==levels(Sleep)[x]],nboot = 900)[AExtrP],
                          mc.cores = parallel::detectCores(), mc.allow.recursive = TRUE)
  EffS5=WRS2::yuen(DepV~Age,data=DatSel)[6]
  EffS5b=WRS2::t1waybt(DepV~Age,data=DatSel,nboot = 900)[AExtrP]
  
  ConEntre.b2<-round(data.table(c(unlist(EffA),unlist(EffB),unlist(EffS5))),Prc)
  ContrBooth1<-rbind(do.call(rbind, lapply(EffAb, as.data.table)),
                     do.call(rbind, lapply(EffBb, as.data.table)),
                     as.data.table(EffS5b))
  ContrBooth<-round(ContrBooth1,Prc)
  ContrBooth$p.value<-round(ContrBooth1$p.value,4)
  names(ContrBooth)<-c("Test.Boot","p.Boot","EffSize.Boot")
    ConEntre.b3<-data.table(Contr=c("Sleep on Young", "Sleep on Old", "Age on Control", "Age on SR", "YSR vs OC"),ConEntre.b1,EfSize=ConEntre.b2,ContrBooth)
    ExFin$DetallExt<-ConEntre.b3
   
   return(ExFin)
  }
  
  AOVMx<-function(A=2,B=2,C=4,DatPas,DatEfSp,nBMM1=10000,nBMM2=10000,Prc=2) {
  # Omnibus design {2*2*(4*S)}
  # bbwtrim, bbwtrimbt, bbwtrimbt_vMM  
  # ContC, rmmcp, rmmismcp, yuendv2
  # En Ef Simples de A*B en cada Momento, como AOVBwF
    ExFin<-list()
  ResRo<-list()
  
  # 1) ANOVA Omnibus
  RsRb<-bbwtrim(A,B,C,DatPas[[2]])
  ResRo$w<- round(c(RsRb$Qa.p.value, RsRb$Qb.p.value, RsRb$Qc.p.value, RsRb$Qab.p.value,RsRb$Qac.p.value,
                    RsRb$Qbc.p.value, RsRb$Qabc.p.value),4)
  ResRo$BT<-c(bbwtrimbt(A,B,C,DatPas[[2]]))
  APA.N1<-c(round(unlist(RsRb),4),round(unlist(ResRo$BT),4))
  rr<-ExtrSig(ResRo$BT)
  print(rr)
  
  ResRo$BT_MM<-c(bbwtrimbt_vMM(A,B,C,DatPas[[2]],nboot = nBMM1))
  ResRo$Rk1<- bdm2way(A,B,DatPas[[2]])
  rr2=ExtrSig(ResRo$BT_MM)
  print(rr2)
      
  ExRsRbQ<-with(RsRb, round(c(Qa, Qb,Qc, Qab, Qac, Qbc, Qabc),Prc))
  ExRsRbp<-with(RsRb, round(c(Qa.p.value, Qb.p.value,Qc.p.value, Qab.p.value, Qac.p.value, Qbc.p.value, Qabc.p.value),4))
  ExFin$AOV<-data.table(ExRsRbQ,ExRsRbp,rr$p.V1,rr$p.Sig,rr2$p.V1,rr2$p.Sig)
  names(ExFin$AOV)<-c("Q","p","pBoot","Sig","pBootMas","Sig2")
  ExFin$AOV<-data.table(Names=c("Age","Sleep","Time","Age*Sleep","Age*Time","Sleep*Time","Age*Sleep*Time"),ExFin$AOV)
   
    
  # 2) Main Effect of C (Time or Trial)
  cnMM<-ContCAll(A=2,B=2,C=4,"Succ") #ContC()
  Contr.1<-rmmcp(DatPas[[2]],con=cnMM)
  Contr.1b<-rmmismcp(DatPas[[2]],con=cnMM)
  ConEntre.b1<-round(as.data.table(cbind(Contr.1$test,Contr.1$psihat)),Prc)[,.(psihat,df,test,p.value)]
  ConEntre.b1$p.value <-round(Contr.1$test[,3],4)
  ConEntre.b1b<-as.data.table(cbind(round(Contr.1b$output[,2],Prc), round(Contr.1b$output[,3],4)))
  names(ConEntre.b1b)<-c("Psihat2","p.value2")
  ContrFunde<-cbind(ConEntre.b1,ConEntre.b1b)
  ContrFunde<-ContrFunde[,-2]
  ConEntre.b3Ap<-ContrFunde[,.(psihat,df=NA,test, p.value,Psihat2, p.value2)]
      
  # Approximation to estimate Effect Size
  EffS1=yuendv2(DatPas[[1]][,T1],DatPas[[1]][,T2])$Effect.Size
  EffS2=yuendv2(DatPas[[1]][,T2],DatPas[[1]][,T3])$Effect.Size
  EffS3=yuendv2(DatPas[[1]][,T3],DatPas[[1]][,T4])$Effect.Size
  ConEntre.b2<-round(data.table(unlist(rbind(EffS1,EffS2,EffS3))),Prc)
  ConEntre.b3<-data.table(Contr=c("M1-M2", "M2-M3", "M3-M4"),ContrFunde,EfSize=ConEntre.b2)
  ExFin$DetallMainC<-ConEntre.b3
  
  # 3) Learning (Time/Trial) on AB (each experimental condition)
  cnMM.Ap<-ContCAll(A=2,B=2,C=4,"Succ.EfS") #ContABC.Learn
  Contr.1<-rmmcp(DatPas[[2]],con=cnMM.Ap)
  Contr.1b<-rmmismcp(DatPas[[2]],con=cnMM.Ap)
  ConEntre.b1<-round(as.data.table(cbind(Contr.1$test,Contr.1$psihat)),Prc)[,.(psihat,df,test,p.value)]
  ConEntre.b1$p.value <-round(Contr.1$test[,3],4)
  ConEntre.b1b<-as.data.table(cbind(round(Contr.1b$output[,2],Prc), round(Contr.1b$output[,3],4)))
  names(ConEntre.b1b)<-c("Psihat2","p.value2")
  ContrFunde<-cbind(ConEntre.b1,ConEntre.b1b)
  
  TestContr2<-rbind(yuendv2(DatPas[[1]][.("Young","Control"),T1],
                              DatPas[[1]][.("Young","Control"),T2])
                      [c("dif","df","teststat","Effect.Size","p.value")],
                      yuendv2(DatPas[[1]][.("Young","SR"),T1],
                              DatPas[[1]][.("Young","SR"),T2])
                      [c("dif","df","teststat","Effect.Size","p.value")],
                      yuendv2(DatPas[[1]][.("Old","Control"),T1],
                              DatPas[[1]][.("Old","Control"),T2])
                      [c("dif","df","teststat","Effect.Size","p.value")],
                      yuendv2(DatPas[[1]][.("Old","SR"),T1],
                              DatPas[[1]][.("Old","SR"),T2])
                      [c("dif","df","teststat","Effect.Size","p.value")],
                      yuendv2(DatPas[[1]][.("Young","Control"),T2],
                              DatPas[[1]][.("Young","Control"),T3])
                      [c("dif","df","teststat","Effect.Size","p.value")],
                      yuendv2(DatPas[[1]][.("Young","SR"),T2],
                              DatPas[[1]][.("Young","SR"),T3])
                      [c("dif","df","teststat","Effect.Size","p.value")],
                      yuendv2(DatPas[[1]][.("Old","Control"),T2],
                              DatPas[[1]][.("Old","Control"),T3])
                      [c("dif","df","teststat","Effect.Size","p.value")],
                      yuendv2(DatPas[[1]][.("Old","SR"),T2],
                              DatPas[[1]][.("Old","SR"),T3])
                      [c("dif","df","teststat","Effect.Size","p.value")],
                      yuendv2(DatPas[[1]][.("Young","Control"),T3],
                              DatPas[[1]][.("Young","Control"),T4])
                      [c("dif","df","teststat","Effect.Size","p.value")],
                      yuendv2(DatPas[[1]][.("Young","SR"),T3],
                              DatPas[[1]][.("Young","SR"),T4])
                      [c("dif","df","teststat","Effect.Size","p.value")],
                      yuendv2(DatPas[[1]][.("Old","Control"),T3],
                              DatPas[[1]][.("Old","Control"),T4])
                      [c("dif","df","teststat","Effect.Size","p.value")],
                      yuendv2(DatPas[[1]][.("Old","SR"),T3],
                              DatPas[[1]][.("Old","SR"),T4])
                      [c("dif","df","teststat","Effect.Size","p.value")])
    
    ConEntre.b3Ap<-data.table(Contr=c("M1-M2 on Y_C", "M1-M2 on Y_SR", "M1-M2 on O_C", "M1-M2 on O_SR",
                                      "M2-M3 on Y_C", "M2-M3 on Y_SR", "M2-M3 on O_C", "M2-M3 on O_SR",
                                      "M3-M4 on Y_C", "M3-M4 on Y_SR", "M3-M4 on O_C", "M3-M4 on O_SR"),
                              ContrFunde)
    ConEntre.b3Ap<-ConEntre.b3Ap[,-3]
    ConEntre.b3Ap<-ConEntre.b3Ap[,.(Contr,psihat,df=NA,test, p.value,Psihat2, p.value2)]
    rrF<-data.table(ConEntre.b3Ap,dif.yuen=round(unlist(TestContr2[,1]),Prc),df.yuen=unlist(TestContr2[,2]),
                    test.yuen=round(unlist(TestContr2[,3]),Prc),EffSize.yuen=round(unlist(TestContr2[,4]),Prc),
                    pvaluet.yuen=round(unlist(TestContr2[,5]),4))
    ExFin$DetallTrialCadaCondAB<-rrF
    
    # 4) Simple Effect AxB on each Trial/Time
    ExFin$DetallSimple<-lapply(1:C, function (is) AOVBwF(2,2,DatPas = DatEfSp[[is]],nBMM2))  
    
    return(ExFin)
  }
  
  AOVMx2<-function(A=2,B=2,C=4,DatPas,DatEfSp,nBMM1=10000,nBMM2=10000,Prc=2) {
    require(parallel);require(data.table)
  # Omnibus design {2*2*(4*S)}
  # bbwtrim, bbwtrimbt, bbwtrimbt_vMM  
  # ContC, rmmcp, rmmismcp, yuendv2
  # En Ef Simples de A*B en cada Momento, como AOVBwF
    ExFin<-list()
  ResRo<-list()
  
  # 1) ANOVA Omnibus
  RsRb<-bbwtrim(A,B,C,DatPas[[2]])
  ResRo$w<- round(c(RsRb$Qa.p.value, RsRb$Qb.p.value, RsRb$Qc.p.value, RsRb$Qab.p.value,RsRb$Qac.p.value,
                    RsRb$Qbc.p.value, RsRb$Qabc.p.value),4)
  ResRo$BT<-c(bbwtrimbt(A,B,C,DatPas[[2]]))
  APA.N1<-c(round(unlist(RsRb),4),round(unlist(ResRo$BT),4))
  rr<-ExtrSig(ResRo$BT)
  print(rr)
  
  ResRo$BT_MM<-c(bbwtrimbt_vMM(A,B,C,DatPas[[2]],nboot = nBMM1))
  ResRo$Rk1<- bdm2way(A,B,DatPas[[2]])
  rr2=ExtrSig(ResRo$BT_MM)
  print(rr2)
      
  ExRsRbQ<-with(RsRb, round(c(Qa, Qb,Qc, Qab, Qac, Qbc, Qabc),Prc))
  ExRsRbp<-with(RsRb, round(c(Qa.p.value, Qb.p.value,Qc.p.value, Qab.p.value, Qac.p.value, Qbc.p.value, Qabc.p.value),4))
  ExFin$AOV<-data.table(ExRsRbQ,ExRsRbp,rr$p.V1,rr$p.Sig,rr2$p.V1,rr2$p.Sig)
  names(ExFin$AOV)<-c("Q","p","pBoot","Sig","pBootMas","Sig2")
  ExFin$AOV<-data.table(Names=c("Age","Sleep","Time","Age*Sleep","Age*Time","Sleep*Time","Age*Sleep*Time"),ExFin$AOV)
   
  # 2) Interaction AB
  # A on each B & B on each A
  cnMM<-ContCAll(A=2,B=2,C=4,"Desgl.AB") #ContAB 
  Contr.1<-lincon(DatPas[[2]],con=cnMM)
  ConEntre.b1<-round(as.data.table(cbind(Contr.1$test,Contr.1$psihat)),Prc)[,.(psihat,df,test,p.value)]
  ConEntre.b1$p.value <-round(Contr.1$psihat[,5],4)
  
  # Approximation to estimate Effect Size
  DatPas[[1]][,NewIntra:=rowMeans(DatPas[[1]][,.(T1,T2,T3,T4)],na.rm = T)]
  
  EffA<-parallel::mclapply(1:A, function(x) WRS2::yuen(NewIntra~Sleep,data=DatPas[[1]][Age==levels(Age)[x]])[6],
                           mc.cores = parallel::detectCores(), mc.allow.recursive = TRUE)
  EffB<-parallel::mclapply(1:B, function(x) WRS2::yuen(NewIntra~Age,data=DatPas[[1]][Sleep==levels(Sleep)[x]])[6], 
                           mc.cores = parallel::detectCores(), mc.allow.recursive = TRUE)
  ConEntre.b2<-round(data.table(c(unlist(EffA),unlist(EffB))),Prc)
  ConEntre.b3<-data.table(Contr=c("Sleep on Young", "Sleep on Old", "Age on Control",
                                    "Age on SR"),ConEntre.b1,EfSize=ConEntre.b2)
  ExFin$InterAB<-as.data.table(ConEntre.b3)
    
  # 3) Interaction AC
  # A on each Moment/Time/Trial of C
  cnMM<-ContCAll(A=2,B=2,C=4,"AenC")  #ContAC 
  Contr.1<-lincon(DatPas[[2]],con=cnMM)
  ConEntre.b1<-round(as.data.table(cbind(Contr.1$test,Contr.1$psihat)),Prc)[,.(psihat,df,test,p.value)]
  ConEntre.b1$p.value <-round(Contr.1$psihat[,5],4)
    
  # Approximation to estimate Effect Size
  levIS<-paste0("T",1:C)
  EffS<-parallel::mclapply(1:C, function(x) WRS2::yuen(get(levIS[x])~Age,data=DatPas[[1]])[6],mc.cores = parallel::detectCores(), mc.allow.recursive = TRUE)
  ConEntre.b2<-round(data.table(unlist(EffS)),Prc)
  ConEntre.b3<-data.table(Contr=c("Age on M1", "Age on M2", "Age on M3", "Age on M4"),ConEntre.b1,EfSize=ConEntre.b2)
  
  # Learning on AC
  cnMM.Ap<-ContCAll(A=2,B=2,C=4,"Succ.AC") #ContAC.Learn 
  Contr.1Ap<-rmmcp(DatPas[[2]],con=cnMM.Ap)
  ConEntre.b1Ap<-round(as.data.table(cbind(Contr.1Ap$test,Contr.1Ap$psihat)),Prc)[,.(psihat,df,test,p.value)]
  ConEntre.b1Ap$p.value <-round(Contr.1Ap$test[,3],4)
    
  # Approximation to estimate Effect Size
  LosLv<-split(c(rep("T1",2),rep("T2",2),rep("T3",2),rep("T2",2),rep("T3",2),rep("T4",2)),1:6)
  LosLv2<-rep(levels(DatPas[[1]]$Age),3)
  EffSAp<- parallel::mclapply(1:6, function(x)   yuendv2(DatPas[[1]][Age==LosLv2[x],get(LosLv[[x]][1])],
                                               DatPas[[1]][Age==LosLv2[x],get(LosLv[[x]][2])])$Effect.Size,
                              mc.cores = parallel::detectCores(), mc.allow.recursive = TRUE)
  ConEntre.b2Ap<-round(data.table(unlist(EffSAp)),Prc)
  ConEntre.b3Ap<-data.table(Contr=c("M1-M2 on Young", "M1-M2 on Old", "M2-M3 on Young", "M2-M3 on Old",
                                    "M3-M4 on Young", "M3-M4 on Old"),ConEntre.b1Ap,EfSize=ConEntre.b2Ap)
  ConEntre.b3Ap<-ConEntre.b3Ap[,-3]
  ConEntre.b3Ap<-ConEntre.b3Ap[,.(Contr,psihat,df=NA,test, p.value ,EfSize.V1)]
  ConEntre.b3.Funde<-rbind(ConEntre.b3,ConEntre.b3Ap)
  #write.csv2(as.data.table(ConEntre.b3.Funde),paste0(NmBas,"ContrAC.csv"))
  ExFin$InterAC<-as.data.table(ConEntre.b3.Funde)
    
  # 4) Interaction BC
  # B on each Moment/Time/Trial C
  cnMM.2<-ContCAll(A=2,B=2,C=4,"BenC") #ContBC 
  Contr.2<-lincon(DatPas[[2]],con= cnMM.2)
  ConEntre.2.b1<-round(as.data.table(cbind(Contr.2$test,Contr.2$psihat)),Prc)[,.(psihat,df,test,p.value)]
  ConEntre.2.b1$p.value <-round(Contr.2$psihat[,5],4)
  
  # Approximation to estimate Effect Size
  levIS<-paste0("T",1:C)
  EffS<-parallel::mclapply(1:C, function(x) WRS2::yuen(get(levIS[x])~Sleep,data=DatPas[[1]])[6],
                           mc.cores = parallel::detectCores(), mc.allow.recursive = TRUE)
  ConEntre.2.b2<-round(data.table(unlist(EffS)),Prc)
  ConEntre.2.b3<-data.table(Contr=c("Sleep on M1", "Sleep on M2", "Sleep on M3",
                                    "Sleep on M4"),ConEntre.2.b1,EfSize=ConEntre.2.b2)
  
  # Learning on BC
  cnMM.Ap2<-ContCAll(A=2,B=2,C=4,"Succ.BC")  #ContBC.Learn 
  Contr.1Ap2<-rmmcp(DatPas[[2]],con=cnMM.Ap2)
  ConEntre.b1Ap2<-round(as.data.table(cbind( Contr.1Ap2$test, Contr.1Ap2$psihat)),Prc)[,.(psihat,df,test,p.value)]
  ConEntre.b1Ap2$p.value <-round(Contr.1Ap2$test[,3],4)
  
  # Approximation to estimate Effect Size
  LosLv<-split(c(rep("T1",2),rep("T2",2),rep("T3",2),rep("T2",2),rep("T3",2),rep("T4",2)),1:6)
  LosLv2<-rep(levels(DatPas[[1]]$Sleep),3)
  EffSAp<- parallel::mclapply(1:6, function(x)   yuendv2(DatPas[[1]][Sleep==LosLv2[x],get(LosLv[[x]][1])],
                                               DatPas[[1]][Sleep==LosLv2[x],get(LosLv[[x]][2])])$Effect.Size,
                              mc.cores = parallel::detectCores(), mc.allow.recursive = TRUE)
  ConEntre.b2Ap2<-round(data.table(unlist(EffSAp)),Prc)
  ConEntre.b3Ap2<-data.table(Contr=c("M1-M2 on Control", "M1-M2 on SR", "M2-M3 on Control", "M2-M3 on SR",
                                     "M3-M4 on Control", "M3-M4 on SR"),ConEntre.b1Ap2,EfSize=ConEntre.b2Ap2)
  ConEntre.b3Ap2<-ConEntre.b3Ap2[,-3]
  ConEntre.b3Ap2<-ConEntre.b3Ap2[,.(Contr,psihat,df=NA,test, p.value ,EfSize.V1)]
  ConEntre.b3.Funde2<-rbind(ConEntre.2.b3,ConEntre.b3Ap2)
  ExFin$InterBC<-as.data.table(ConEntre.b3.Funde2)
  
  # 5) Main Effect of C (Trial/Moment/Time)
  cnMM<-ContCAll(A=2,B=2,C=4,"Succ") #ContC()
  Contr.1<-rmmcp(DatPas[[2]],con=cnMM)
  Contr.1b<-rmmismcp(DatPas[[2]],con=cnMM)
  ConEntre.b1<-round(as.data.table(cbind(Contr.1$test,Contr.1$psihat)),Prc)[,.(psihat,df,test,p.value)]
  ConEntre.b1$p.value <-round(Contr.1$test[,3],4)
  ConEntre.b1b<-as.data.table(cbind(round(Contr.1b$output[,2],Prc), round(Contr.1b$output[,3],4)))
  names(ConEntre.b1b)<-c("Psihat2","p.value2")
  ContrFunde<-cbind(ConEntre.b1,ConEntre.b1b)
  ContrFunde<-ContrFunde[,-2]
  ConEntre.b3Ap<-ContrFunde[,.(psihat,df=NA,test, p.value,Psihat2, p.value2)]
      
  # Approximation to estimate Effect Size
  LosLv<-split(c("T1","T2","T3","T2","T3","T4"),1:3)
  EffSAp2<- parallel::mclapply(1:3, function(x) yuendv2(DatPas[[1]][,get(LosLv[[x]][1])],DatPas[[1]][,get(LosLv[[x]][2])])$Effect.Size,
                               mc.cores = parallel::detectCores(), mc.allow.recursive = TRUE)
  ConEntre.b2<-round(data.table(unlist(EffSAp2)),Prc)
  ConEntre.b3<-data.table(Contr=c("M1-M2", "M2-M3", "M3-M4"),ContrFunde,EfSize=ConEntre.b2)
  ExFin$DetallMainC<-ConEntre.b3
  
  # 6) Learning (successive Trial/Time/Moment) on AB (each experimental condition)
  cnMM.Ap<-ContCAll(A=2,B=2,C=4,"Succ.EfS") #ContABC.Learn
  Contr.1<-rmmcp(DatPas[[2]],con=cnMM.Ap)
  Contr.1b<-rmmismcp(DatPas[[2]],con=cnMM.Ap)
  ConEntre.b1<-round(as.data.table(cbind(Contr.1$test,Contr.1$psihat)),Prc)[,.(psihat,df,test,p.value)]
  ConEntre.b1$p.value <-round(Contr.1$test[,3],4)
  ConEntre.b1b<-as.data.table(cbind(round(Contr.1b$output[,2],Prc), round(Contr.1b$output[,3],4)))
  names(ConEntre.b1b)<-c("Psihat2","p.value2")
  ContrFunde<-cbind(ConEntre.b1,ConEntre.b1b)
  
  DtIntra<-copy(DatPas[[1]]);
  DtIntra[,Inter:=interaction(Age,Sleep)]
  DtIntra$Inter<-factor(DtIntra$Inter,levels=c("Young.Control", "Young.SR", "Old.Control","Old.SR"))
  AExtr<-c("dif","df","teststat","Effect.Size","p.value")
  LosLv<-split(c(rep("T1",4),rep("T2",4),rep("T3",4),rep("T2",4),rep("T3",4),rep("T4",4)),1:12)
  LosLv2<-rep(levels(DtIntra$Inter),3)
  EffSApC<- parallel::mclapply(1:12, function(x)   yuendv2(DtIntra[Inter==LosLv2[x],get(LosLv[[x]][1])],
                                               DtIntra[Inter==LosLv2[x],get(LosLv[[x]][2])])
                                                [AExtr],
                               mc.cores = parallel::detectCores(), mc.allow.recursive = TRUE)
  TestContr2<-data.table(do.call(rbind, setNames(EffSApC,AExtr)))
  ConEntre.b3Ap<-data.table(Contr=c("M1-M2 on Y_C", "M1-M2 on Y_SR", "M1-M2 on O_C", "M1-M2 on O_SR",
                                      "M2-M3 on Y_C", "M2-M3 on Y_SR", "M2-M3 on O_C", "M2-M3 on O_SR",
                                      "M3-M4 on Y_C", "M3-M4 on Y_SR", "M3-M4 on O_C", "M3-M4 on O_SR"),
                              ContrFunde)
    ConEntre.b3Ap<-ConEntre.b3Ap[,-3]
    ConEntre.b3Ap<-ConEntre.b3Ap[,.(Contr,psihat,df=NA,test, p.value,Psihat2, p.value2)]
    rrF<-data.table(ConEntre.b3Ap,dif.yuen=round(unlist(TestContr2[,1]),Prc),df.yuen=unlist(TestContr2[,2]),
                    test.yuen=round(unlist(TestContr2[,3]),Prc),EffSize.yuen=round(unlist(TestContr2[,4]),Prc),
                    pvaluet.yuen=round(unlist(TestContr2[,5]),4))
    ExFin$DetallTrialCadaCondAB<-rrF
    
    # 7) Simple Simple Effect AxB on each Trial/Moment/Time
    ExFin$DetallSimple<-parallel::mclapply(1:C, function (is) AOVBwF(2,2,DatPas = DatEfSp[[is]],nBMM2),
                                           mc.cores = parallel::detectCores(), mc.allow.recursive = TRUE)  
    
    return(ExFin)
  }
  
  AOVMx2b<-function(A=2,C=4,DatPas,DatEfSp,nBMM1=10000,nBMM2=10000,Prc=2) {
    require(parallel);require(data.table)
  #A=2;C=4;DatPas = rrt;DatEfSp = DatEfS;nBMM1 = 10000;nBMM2 = 1000;Prc = 2
  # Omnibus design {2*(4*S)} & {2*(5*S)} 
  # bbwtrim, bbwtrimbt, bbwtrimbt_vMM  
  # ContC, rmmcp, rmmismcp, yuendv2
  # En Ef Simples de A*B en cada Momento, como AOVBwF
    ExFin<-list()
  ResRo<-list()
  rr2<-rr<-list()
  
  # 1) ANOVA Omnibus
  RsRb<-bwtrim(A,C,DatPas[[2]])
  ResRo$w<- round(c(RsRb$Qa.p.value, RsRb$Qb.p.value, RsRb$Qab.p.value),4)
  ResRo$BT<-try(c(bwtrimbt(A,C,DatPas[[2]])))
  APA.N1<-try(c(round(unlist(RsRb),Prc),round(unlist(ResRo$BT),Prc)))
  rr<-try(ExtrSig(ResRo$BT))
  #print(rr)
  ResRo$BT_MM<-try(c(bwtrimbt(A,C,DatPas[[2]],nboot = nBMM1)))
  rr2=try(ExtrSig(ResRo$BT_MM))
  #print(rr2)
  
  is_try_error <- function(x) inherits(x, "try-error")
  if (is_try_error(rr)) {rr<-list();rr$p.V1<-NA;rr$p.Sig<-NA}
  if (is_try_error(rr2)) {rr2<-list();rr2$p.V1<-NA;rr2$p.Sig<-NA}
  
  ExRsRbp<-with(RsRb, round(c(Qa.p.value, Qb.p.value,Qab.p.value),4))
  ExRsRbQ<-with(RsRb, round(c(Qa, Qb, Qab),Prc))
  ExFin$AOV<-data.table(ExRsRbQ,ExRsRbp,rr$p.V1,rr$p.Sig,rr2$p.V1,rr2$p.Sig)
  names(ExFin$AOV)<-c("Q","p","pBoot","Sig","pBootMas","Sig2")
  ExFin$AOV<-data.table(Names=c("Age","Trial","Age*Trial"),ExFin$AOV)
  
  TamA=round(mean(ESmainMCP(A,C,DatPas[[2]])$Factor.A[,3]),Prc)
    TamB=round(mean(ESmainMCP(A,C,DatPas[[2]])$Factor.B[,3]),Prc)
    TamInt=round(mean(esImcp(A,C,DatPas[[2]])$Effect.Sizes),Prc)
  ExFin$AOV[,EffSize:=c(TamA,TamB,TamInt)]
  
  # 2) Interaction AB
  # A on each C & C on each A
  cnMM<-ContCAll(A=A,B=1,C=C,"AenC") #ContAenBMixto 
  Contr.1<-lincon(DatPas[[2]],con=cnMM)
  ConEntre.b1<-round(as.data.table(cbind(Contr.1$test,Contr.1$psihat)),Prc)[,.(psihat,df,test,p.value)]
  ConEntre.b1$p.value <-round(Contr.1$psihat[,5],4)
  
  # A on each C
  # Approximation to estimate Effect Size
  levIS<-paste0("T",1:C)
  EffS<-parallel::mclapply(1:C, function(x) WRS2::yuen(get(levIS[x])~Group,data=DatPas[[1]])[6],mc.cores = parallel::detectCores(), mc.allow.recursive = TRUE)
  ConEntre.b2<-round(data.table(unlist(EffS)),Prc)
  ConEntre.b3<-data.table(Contr=c(paste0("Age on M",1:C)),ConEntre.b1,EfSize=ConEntre.b2)
  
  # Learning (successive Time/Moment/Trial) on AC
  cnMM.Ap<-ContCAll(A=A,B=1,C=C,"Succ.AC") #ContBenAMixto 
  Contr.1Ap<-rmmcp(DatPas[[2]],con=cnMM.Ap)
  ConEntre.b1Ap<-round(as.data.table(cbind(Contr.1Ap$test,Contr.1Ap$psihat)),Prc)[,.(psihat,df,test,p.value)]
  ConEntre.b1Ap$p.value <-round(Contr.1Ap$test[,3],4)
  
  # C on each A  
  # Approximation to estimate Effect Size
  if (C==4) {
    LosLv<-split(c(rep("T1",2),rep("T2",2),rep("T3",2),rep("T2",2),rep("T3",2),rep("T4",2)),1:6)
    LosLv2<-rep(levels(DatPas[[1]]$Group),3)
    EffSAp<- parallel::mclapply(1:6, function(x)   yuendv2(DatPas[[1]][Group==LosLv2[x],get(LosLv[[x]][1])],
                                               DatPas[[1]][Group==LosLv2[x],get(LosLv[[x]][2])])$Effect.Size,
                              mc.cores = parallel::detectCores(), mc.allow.recursive = TRUE)
    ConEntre.b2Ap<-round(data.table(unlist(EffSAp)),Prc)
    ConEntre.b3Ap<-data.table(Contr=c("M1-M2 on Young", "M1-M2 on Old", "M2-M3 on Young", "M2-M3 on Old",
                                    "M3-M4 on Young", "M3-M4 on Old"),ConEntre.b1Ap,EfSize=ConEntre.b2Ap)
  }
  if (C==5) {
    LosLv<-split(c(rep("T1",2),rep("T2",2),rep("T3",2),rep("T4",2),rep("T2",2),rep("T3",2),rep("T4",2),rep("T5",2)),1:8)
  LosLv2<-rep(levels(DatPas[[1]]$Group),4)
  EffSAp<- parallel::mclapply(1:8, function(x)   yuendv2(DatPas[[1]][Group==LosLv2[x],get(LosLv[[x]][1])],
                                               DatPas[[1]][Group==LosLv2[x],get(LosLv[[x]][2])])$Effect.Size,
                              mc.cores = parallel::detectCores(), mc.allow.recursive = TRUE)
  ConEntre.b2Ap<-round(data.table(unlist(EffSAp)),Prc)
  ConEntre.b3Ap<-data.table(Contr=c("M1-M2 on Young", "M1-M2 on Old", "M2-M3 on Young", "M2-M3 on Old",
                                    "M3-M4 on Young", "M3-M4 on Old", "M4-M5 on Young", "M4-M5 on Old"),
                            ConEntre.b1Ap,EfSize=ConEntre.b2Ap)
  }
  ConEntre.b3Ap<-ConEntre.b3Ap[,-3]
  ConEntre.b3Ap<-ConEntre.b3Ap[,.(Contr,psihat,df=NA,test, p.value ,EfSize.V1)]
  ConEntre.b3.Funde<-rbind(ConEntre.b3,ConEntre.b3Ap)
  #write.csv2(as.data.table(ConEntre.b3.Funde),paste0(NmBas,"ContrAC.csv"))
  ExFin$InterAC<-as.data.table(ConEntre.b3.Funde)
    
  # 3) Main Effect of C (Trial/Moment/Time)
  cnMM<-ContCAll(A=A,B=1,C=C,"Succ") #ContC.3b
  Contr.1<-rmmcp(DatPas[[2]],con=cnMM)
  Contr.1b<-rmmismcp(DatPas[[2]],con=cnMM)
  ConEntre.b1<-round(as.data.table(cbind(Contr.1$test,Contr.1$psihat)),Prc)[,.(psihat,df,test,p.value)]
  ConEntre.b1$p.value <-round(Contr.1$test[,3],4)
  ConEntre.b1b<-as.data.table(cbind(round(Contr.1b$output[,2],Prc), round(Contr.1b$output[,3],4)))
  names(ConEntre.b1b)<-c("Psihat2","p.value2")
  ContrFunde<-cbind(ConEntre.b1,ConEntre.b1b)
  ContrFunde<-ContrFunde[,-2]
  ConEntre.b3Ap<-ContrFunde[,.(psihat,df=NA,test, p.value,Psihat2, p.value2)]
      
  # Approximation to estimate Effect Size
  if (C==4) {
    LosLv<-split(c("T1","T2","T3","T2","T3","T4"),1:3)
    EffSAp2<- parallel::mclapply(1:3, function(x) yuendv2(DatPas[[1]][,get(LosLv[[x]][1])],DatPas[[1]][,get(LosLv[[x]][2])])$Effect.Size,
                               mc.cores = parallel::detectCores(), mc.allow.recursive = TRUE)
    ConEntre.b2<-round(data.table(unlist(EffSAp2)),Prc)
    ConEntre.b3<-data.table(Contr=c("M1-M2", "M2-M3", "M3-M4"),ContrFunde,EfSize=ConEntre.b2)  
  }
  if (C==5) {
    LosLv<-split(c("T1","T2","T3","T4","T2","T3","T4","T5"),1:4)
    EffSAp2<- parallel::mclapply(1:4, function(x) yuendv2(DatPas[[1]][,get(LosLv[[x]][1])],DatPas[[1]][,get(LosLv[[x]][2])])$Effect.Size,
                               mc.cores = parallel::detectCores(), mc.allow.recursive = TRUE)
    ConEntre.b2<-round(data.table(unlist(EffSAp2)),Prc)
    ConEntre.b3<-data.table(Contr=c("M1-M2", "M2-M3", "M3-M4", "M4-M5"),ContrFunde,EfSize=ConEntre.b2)
  }
  ExFin$DetallMainC<-ConEntre.b3
  
    return(ExFin)
  }
  
  AOVMx2.2<-function(A=2,B=2,C=2,DatPas,DatEfSp,nBMM1=10000,nBMM2=10000,Prc=2) {
    require(parallel);require(data.table)
  # Variant for Intra variable of 2 levels
  # Omnibus design {2*2*(2*S)}
  # bbwtrim, bbwtrimbt, bbwtrimbt_vMM  
  # ContC, rmmcp, rmmismcp, yuendv2
  # On Simple Effects of AxB on each Moment/Trual/Moment, as in AOVBwF
    ExFin<-list()
  ResRo<-list()
  
  # 1) ANOVA Omnibus
  RsRb<-bbwtrim(A,B,C,DatPas[[2]])
  ResRo$w<- round(c(RsRb$Qa.p.value, RsRb$Qb.p.value, RsRb$Qc.p.value, RsRb$Qab.p.value,RsRb$Qac.p.value,
                    RsRb$Qbc.p.value, RsRb$Qabc.p.value),4)
  ResRo$BT<-c(bbwtrimbt(A,B,C,DatPas[[2]]))
  APA.N1<-c(round(unlist(RsRb),4),round(unlist(ResRo$BT),4))
  rr<-ExtrSig(ResRo$BT)
  print(rr)
  
  ResRo$BT_MM<-c(bbwtrimbt_vMM(A,B,C,DatPas[[2]],nboot = nBMM1))
  ResRo$Rk1<- bdm2way(A,B,DatPas[[2]])
  rr2=ExtrSig(ResRo$BT_MM)
  print(rr2)
      
  ExRsRbQ<-with(RsRb, round(c(Qa, Qb,Qc, Qab, Qac, Qbc, Qabc),Prc))
  ExRsRbp<-with(RsRb, round(c(Qa.p.value, Qb.p.value,Qc.p.value, Qab.p.value, Qac.p.value, Qbc.p.value, Qabc.p.value),4))
  ExFin$AOV<-data.table(ExRsRbQ,ExRsRbp,rr$p.V1,rr$p.Sig,rr2$p.V1,rr2$p.Sig)
  names(ExFin$AOV)<-c("Q","p","pBoot","Sig","pBootMas","Sig2")
  ExFin$AOV<-data.table(Names=c("Age","Sleep","Time","Age*Sleep","Age*Time","Sleep*Time","Age*Sleep*Time"),ExFin$AOV)
   
  # 2) Interacion AB
  # A on each B & B on each A
  cnMM<-ContCAll(A=2,B=2,C=2,"Desgl.AB") #ContAB.2Intra 
  Contr.1<-lincon(DatPas[[2]],con=cnMM)
  ConEntre.b1<-round(as.data.table(cbind(Contr.1$test,Contr.1$psihat)),Prc)[,.(psihat,df,test,p.value)]
  ConEntre.b1$p.value <-round(Contr.1$psihat[,5],4)
  
  # Approximation to estimate Effect Size
  DatPas[[1]][,NewIntra:=rowMeans(DatPas[[1]][,.(T1,T2)],na.rm = T)]
  
  EffA<-parallel::mclapply(1:A, function(x) WRS2::yuen(NewIntra~Sleep,data=DatPas[[1]][Age==levels(Age)[x]])[6],
                           mc.cores = parallel::detectCores(), mc.allow.recursive = TRUE)
  EffB<-parallel::mclapply(1:B, function(x) WRS2::yuen(NewIntra~Age,data=DatPas[[1]][Sleep==levels(Sleep)[x]])[6], 
                           mc.cores = parallel::detectCores(), mc.allow.recursive = TRUE)
  ConEntre.b2<-round(data.table(c(unlist(EffA),unlist(EffB))),Prc)
  ConEntre.b3<-data.table(Contr=c("Sleep on Young", "Sleep on Old", "Age on Control",
                                    "Age on SR"),ConEntre.b1,EfSize=ConEntre.b2)
  ExFin$InterAB<-as.data.table(ConEntre.b3)
  
  # 3) Interaction AC
  # A on each C
  cnMM<-ContCAll(A=2,B=2,C=2,"AenC")  #ContAC.2Intra 
  Contr.1<-lincon(DatPas[[2]],con=cnMM)
  ConEntre.b1<-round(as.data.table(cbind(Contr.1$test,Contr.1$psihat)),Prc)[,.(psihat,df,test,p.value)]
  ConEntre.b1$p.value <-round(Contr.1$psihat[,5],4)
    
  # Approximation to estimate Effect Size
  levIS<-paste0("T",1:C)
  EffS<-parallel::mclapply(1:C, function(x) WRS2::yuen(get(levIS[x])~Age,data=DatPas[[1]])[6],mc.cores = parallel::detectCores(), mc.allow.recursive = TRUE)
  ConEntre.b2<-round(data.table(unlist(EffS)),Prc)
  ConEntre.b3<-data.table(Contr=c("Age on M1", "Age on M2"),ConEntre.b1,EfSize=ConEntre.b2)
  
  # Learning (successive) on AC
  cnMM.Ap<-ContCAll(A=2,B=2,C=2,"Succ.AC")  #ContAC.2Learn 
  Contr.1Ap<-rmmcp(DatPas[[2]],con=cnMM.Ap)
  ConEntre.b1Ap<-round(as.data.table(cbind(Contr.1Ap$test,Contr.1Ap$psihat)),Prc)[,.(psihat,df,test,p.value)]
  ConEntre.b1Ap$p.value <-round(Contr.1Ap$test[,3],4)
    
  # Approximation to estimate Effect Size
  LosLv<-split(c(rep("T1",2),rep("T2",2)),1:2)
  LosLv2<-rep(levels(DatPas[[1]]$Age),1)
  EffSAp<- parallel::mclapply(1:2, function(x)   yuendv2(DatPas[[1]][Age==LosLv2[x],get(LosLv[[x]][1])],
                                               DatPas[[1]][Age==LosLv2[x],get(LosLv[[x]][2])])$Effect.Size,
                              mc.cores = parallel::detectCores(), mc.allow.recursive = TRUE)
  ConEntre.b2Ap<-round(data.table(unlist(EffSAp)),Prc)
  ConEntre.b3Ap<-data.table(Contr=c("M1-M2 on Young", "M1-M2 on Old"),ConEntre.b1Ap,EfSize=ConEntre.b2Ap)
  ConEntre.b3Ap<-ConEntre.b3Ap[,-3]
  ConEntre.b3Ap<-ConEntre.b3Ap[,.(Contr,psihat,df=NA,test, p.value ,EfSize.V1)]
  ConEntre.b3.Funde<-rbind(ConEntre.b3,ConEntre.b3Ap)
  #write.csv2(as.data.table(ConEntre.b3.Funde),paste0(NmBas,"ContrAC.csv"))
  ExFin$InterAC<-as.data.table(ConEntre.b3.Funde)
    
  # 4) Interaction BC
  # B on each C
  cnMM.2<-ContCAll(A=2,B=2,C=2,"BenC") #ContBC.2Intra 
  Contr.2<-lincon(DatPas[[2]],con= cnMM.2)
  ConEntre.2.b1<-round(as.data.table(cbind(Contr.2$test,Contr.2$psihat)),Prc)[,.(psihat,df,test,p.value)]
  ConEntre.2.b1$p.value <-round(Contr.2$psihat[,5],4)
  
  # Approximation to estimate Effect Size
  levIS<-paste0("T",1:C)
  EffS<-parallel::mclapply(1:C, function(x) WRS2::yuen(get(levIS[x])~Sleep,data=DatPas[[1]])[6],
                           mc.cores = parallel::detectCores(), mc.allow.recursive = TRUE)
  ConEntre.2.b2<-round(data.table(unlist(EffS)),Prc)
  ConEntre.2.b3<-data.table(Contr=c("Sleep on M1", "Sleep on M2"),ConEntre.2.b1,EfSize=ConEntre.2.b2)
  
  # Learning (successive) on BC
  cnMM.Ap2<-ContCAll(A=2,B=2,C=2,"Succ.BC") #ContBC.2Learn 
  Contr.1Ap2<-rmmcp(DatPas[[2]],con=cnMM.Ap2)
  ConEntre.b1Ap2<-round(as.data.table(cbind( Contr.1Ap2$test, Contr.1Ap2$psihat)),Prc)[,.(psihat,df,test,p.value)]
  ConEntre.b1Ap2$p.value <-round(Contr.1Ap2$test[,3],4)
  
  # Approximation to estimate Effect Size
  LosLv<-split(c(rep("T1",2),rep("T2",2)),1:2)
  LosLv2<-rep(levels(DatPas[[1]]$Sleep),1)
  EffSAp<- parallel::mclapply(1:2, function(x)   yuendv2(DatPas[[1]][Sleep==LosLv2[x],get(LosLv[[x]][1])],
                                               DatPas[[1]][Sleep==LosLv2[x],get(LosLv[[x]][2])])$Effect.Size,
                              mc.cores = parallel::detectCores(), mc.allow.recursive = TRUE)
  ConEntre.b2Ap2<-round(data.table(unlist(EffSAp)),Prc)
  ConEntre.b3Ap2<-data.table(Contr=c("M1-M2 on Control", "M1-M2 on SR"),ConEntre.b1Ap2,EfSize=ConEntre.b2Ap2)
  ConEntre.b3Ap2<-ConEntre.b3Ap2[,-3]
  ConEntre.b3Ap2<-ConEntre.b3Ap2[,.(Contr,psihat,df=NA,test, p.value ,EfSize.V1)]
  ConEntre.b3.Funde2<-rbind(ConEntre.2.b3,ConEntre.b3Ap2)
  #write.csv2(as.data.table(ConEntre.b3.Funde2),paste0(NmBas,"ContrBC.csv"))
  ExFin$InterBC<-as.data.table(ConEntre.b3.Funde2)
  
  # 5) Main Effect of C (Trial/Moment/Time) which I keep although it is not necessary because C = 2
  cnMM<-ContCAll(A=2,B=2,C=2,"Succ") #ContC.2
  Contr.1<-rmmcp(DatPas[[2]],con=cnMM)
  Contr.1b<-rmmismcp(DatPas[[2]],con=cnMM)
  ConEntre.b1<-round(as.data.table(cbind(Contr.1$test,Contr.1$psihat)),Prc)[,.(psihat,df,test,p.value)]
  ConEntre.b1$p.value <-round(Contr.1$test[,3],4)
  ConEntre.b1b<-as.data.table(cbind(round(Contr.1b$output[,2],Prc), round(Contr.1b$output[,3],4)))
  names(ConEntre.b1b)<-c("Psihat2","p.value2")
  ContrFunde<-cbind(ConEntre.b1,ConEntre.b1b)
  ContrFunde<-ContrFunde[,-2]
  ConEntre.b3Ap<-ContrFunde[,.(psihat,df=NA,test, p.value,Psihat2, p.value2)]
      
  # Approximation to estimate Effect Size
  LosLv<-c("T1","T2")
  EffSAp2<- parallel::mclapply(1:1, function(x) yuendv2(DatPas[[1]][,get(LosLv[1])],DatPas[[1]][,get(LosLv[2])])$Effect.Size,
                               mc.cores = parallel::detectCores(), mc.allow.recursive = TRUE)
  ConEntre.b2<-round(data.table(unlist(EffSAp2)),Prc)
  ConEntre.b3<-data.table(Contr=c("M1-M2"),ContrFunde,EfSize=ConEntre.b2)
  ExFin$DetallMainC<-ConEntre.b3
  
  # 6) Learning (successive Trial/Moment/Time) on AB (each experimental condition)
  cnMM.Ap<-ContCAll(A=2,B=2,C=2,"Succ.EfS") #ContABC.2Learn
  Contr.1<-rmmcp(DatPas[[2]],con=cnMM.Ap)
  Contr.1b<-rmmismcp(DatPas[[2]],con=cnMM.Ap)
  ConEntre.b1<-round(as.data.table(cbind(Contr.1$test,Contr.1$psihat)),Prc)[,.(psihat,df,test,p.value)]
  ConEntre.b1$p.value <-round(Contr.1$test[,3],4)
  ConEntre.b1b<-as.data.table(cbind(round(Contr.1b$output[,2],Prc), round(Contr.1b$output[,3],4)))
  names(ConEntre.b1b)<-c("Psihat2","p.value2")
  ContrFunde<-cbind(ConEntre.b1,ConEntre.b1b)
  
  DtIntra<-copy(DatPas[[1]]);
  DtIntra[,Inter:=interaction(Age,Sleep)]
  DtIntra$Inter<-factor(DtIntra$Inter,levels=c("Young.Control", "Young.SR", "Old.Control","Old.SR"))
  AExtr<-c("dif","df","teststat","Effect.Size","p.value")
  LosLv<-split(c(rep("T1",4),rep("T2",4)),1:4)
  LosLv2<-rep(levels(DtIntra$Inter),1)
  x=2
  EffSApC<- parallel::mclapply(1:4, function(x)   yuendv2(DtIntra[Inter==LosLv2[x],get(LosLv[[x]][1])],
                                               DtIntra[Inter==LosLv2[x],get(LosLv[[x]][2])])
                                                [AExtr],
                               mc.cores = parallel::detectCores(), mc.allow.recursive = TRUE)
  TestContr2<-data.table(rbind(unlist(EffSApC[[1]]),unlist(EffSApC[[2]]),unlist(EffSApC[[3]]),unlist(EffSApC[[4]])))
  ConEntre.b3Ap<-data.table(Contr=c("M1-M2 on Y_C", "M1-M2 on Y_SR", "M1-M2 on O_C", "M1-M2 on O_SR"),
                              ContrFunde)
    ConEntre.b3Ap<-ConEntre.b3Ap[,-3]
    ConEntre.b3Ap<-ConEntre.b3Ap[,.(Contr,psihat,df=NA,test, p.value,Psihat2, p.value2)]
    rrF<-data.table(ConEntre.b3Ap,dif.yuen=round(unlist(TestContr2[,1]),Prc),df.yuen=unlist(TestContr2[,2]),
                    test.yuen=round(unlist(TestContr2[,3]),Prc),EffSize.yuen=round(unlist(TestContr2[,4]),Prc),
                    pvaluet.yuen=round(unlist(TestContr2[,5]),4))
    ExFin$DetallTrialCadaCondAB<-rrF
    
    # 7) Simple Simple Effect AxB on each Trial/Moment/Time
    ExFin$DetallSimple<-parallel::mclapply(1:C, function (is) AOVBwF(2,2,DatPas = DatEfSp[[is]],nBMM2),
                                           mc.cores = parallel::detectCores(), mc.allow.recursive = TRUE)  
    
    return(ExFin)
  }
  
  AOVMx2.5<-function(A=2,B=2,C=5,DatPas,DatEfSp,nBMM1=10000,nBMM2=10000,Prc=2) {
    require(parallel);require(data.table)
  # Variant for Intra variable of 5 levels
  # Omnibus design {2*2*(5*S)}
  # bbwtrim, bbwtrimbt, bbwtrimbt_vMM  
  # ContC, rmmcp, rmmismcp, yuendv2
  # On Simple Effects of AxB on each Moment/Trual/Moment, as in AOVBwF
    ExFin<-list()
  ResRo<-list()
  
  # 1) ANOVA Omnibus
  RsRb<-bbwtrim(A,B,C,DatPas[[2]])
  ResRo$w<- round(c(RsRb$Qa.p.value, RsRb$Qb.p.value, RsRb$Qc.p.value, RsRb$Qab.p.value,RsRb$Qac.p.value,
                    RsRb$Qbc.p.value, RsRb$Qabc.p.value),4)
  ResRo$BT<-c(bbwtrimbt(A,B,C,DatPas[[2]]))
  APA.N1<-c(round(unlist(RsRb),4),round(unlist(ResRo$BT),4))
  rr<-ExtrSig(ResRo$BT)
  print(rr)
 
  ResRo$BT_MM<-c(bbwtrimbt_vMM(A,B,C,DatPas[[2]],nboot = nBMM1))
  ResRo$Rk1<- bdm2way(A,B,DatPas[[2]])
  rr2=ExtrSig(ResRo$BT_MM)
  print(rr2)
      
  ExRsRbQ<-with(RsRb, round(c(Qa, Qb,Qc, Qab, Qac, Qbc, Qabc),Prc))
  ExRsRbp<-with(RsRb, round(c(Qa.p.value, Qb.p.value,Qc.p.value, Qab.p.value, Qac.p.value, Qbc.p.value, Qabc.p.value),4))
  ExFin$AOV<-data.table(ExRsRbQ,ExRsRbp,rr$p.V1,rr$p.Sig,rr2$p.V1,rr2$p.Sig)
  names(ExFin$AOV)<-c("Q","p","pBoot","Sig","pBootMas","Sig2")
  ExFin$AOV<-data.table(Names=c("Age","Sleep","Time","Age*Sleep","Age*Time","Sleep*Time","Age*Sleep*Time"),ExFin$AOV)
   
  # 2) Interaction AB
  # A on each B & B on each A
  cnMM<-ContCAll(A=2,B=2,C=5,"Desgl.AB") #ContAB.5 
  Contr.1<-lincon(DatPas[[2]],con=cnMM)
  ConEntre.b1<-round(as.data.table(cbind(Contr.1$test,Contr.1$psihat)),Prc)[,.(psihat,df,test,p.value)]
  ConEntre.b1$p.value <-round(Contr.1$psihat[,5],4)
  
  # Approximation to estimate Effect Size
  DatPas[[1]][,NewIntra:=rowMeans(DatPas[[1]][,.(T1,T2,T3,T4,T5)],na.rm = T)]
  
  EffA<-parallel::mclapply(1:A, function(x) WRS2::yuen(NewIntra~Sleep,data=DatPas[[1]][Age==levels(Age)[x]])[6],
                           mc.cores = parallel::detectCores(), mc.allow.recursive = TRUE)
  EffB<-parallel::mclapply(1:B, function(x) WRS2::yuen(NewIntra~Age,data=DatPas[[1]][Sleep==levels(Sleep)[x]])[6], 
                           mc.cores = parallel::detectCores(), mc.allow.recursive = TRUE)
  ConEntre.b2<-round(data.table(c(unlist(EffA),unlist(EffB))),Prc)
  ConEntre.b3<-data.table(Contr=c("Sleep on Young", "Sleep on Old", "Age on Control",
                                    "Age on SR"),ConEntre.b1,EfSize=ConEntre.b2)
  ExFin$InterAB<-as.data.table(ConEntre.b3)
    
  # 3) Interaction AC
  # A on each Moment/Time/Trial of C
  cnMM<-ContCAll(A=2,B=2,C=5,"AenC") #ContAC.5 
  Contr.1<-lincon(DatPas[[2]],con=cnMM)
  ConEntre.b1<-round(as.data.table(cbind(Contr.1$test,Contr.1$psihat)),Prc)[,.(psihat,df,test,p.value)]
  ConEntre.b1$p.value <-round(Contr.1$psihat[,5],4)
    
  # Approximation to estimate Effect Size
  levIS<-paste0("T",1:C)
  EffS<-parallel::mclapply(1:C, function(x) WRS2::yuen(get(levIS[x])~Age,data=DatPas[[1]])[6],mc.cores = parallel::detectCores(), mc.allow.recursive = TRUE)
  ConEntre.b2<-round(data.table(unlist(EffS)),Prc)
  ConEntre.b3<-data.table(Contr=c("Age on M1", "Age on M2", "Age on M3", "Age on M4","Age on M5"),ConEntre.b1,EfSize=ConEntre.b2)
  
  # Learning (successive Trial/Time/Moment) on AC
  cnMM.Ap<-ContCAll(A=2,B=2,C=5,"Succ.AC") #ContAC.5Learn 
  Contr.1Ap<-rmmcp(DatPas[[2]],con=cnMM.Ap)
  ConEntre.b1Ap<-round(as.data.table(cbind(Contr.1Ap$test,Contr.1Ap$psihat)),Prc)[,.(psihat,df,test,p.value)]
  ConEntre.b1Ap$p.value <-round(Contr.1Ap$test[,3],4)
    
  # Approximation to estimate Effect Size
  LosLv<-split(c(rep("T1",2),rep("T2",2),rep("T3",2),rep("T4",2),rep("T2",2),rep("T3",2),rep("T4",2),rep("T5",2)),1:8)
  LosLv2<-rep(levels(DatPas[[1]]$Age),4)
  EffSAp<- parallel::mclapply(1:8, function(x)   yuendv2(DatPas[[1]][Age==LosLv2[x],get(LosLv[[x]][1])],
                                               DatPas[[1]][Age==LosLv2[x],get(LosLv[[x]][2])])$Effect.Size,
                              mc.cores = parallel::detectCores(), mc.allow.recursive = TRUE)
  ConEntre.b2Ap<-round(data.table(unlist(EffSAp)),Prc)
  ConEntre.b3Ap<-data.table(Contr=c("M1-M2 on Young", "M1-M2 on Old", "M2-M3 on Young", "M2-M3 on Old",
                                    "M3-M4 on Young", "M3-M4 on Old", "M4-M5 on Young", "M4-M5 on Old"),
                            ConEntre.b1Ap,EfSize=ConEntre.b2Ap)
  ConEntre.b3Ap<-ConEntre.b3Ap[,-3]
  ConEntre.b3Ap<-ConEntre.b3Ap[,.(Contr,psihat,df=NA,test, p.value ,EfSize.V1)]
  ConEntre.b3.Funde<-rbind(ConEntre.b3,ConEntre.b3Ap)
  ExFin$InterAC<-as.data.table(ConEntre.b3.Funde)
    
  # 4) Interaction BC
  # B on each C
  cnMM.2<-ContCAll(A=2,B=2,C=5,"BenC") #ContBC.5 
  Contr.2<-lincon(DatPas[[2]],con= cnMM.2)
  ConEntre.2.b1<-round(as.data.table(cbind(Contr.2$test,Contr.2$psihat)),Prc)[,.(psihat,df,test,p.value)]
  ConEntre.2.b1$p.value <-round(Contr.2$psihat[,5],4)
  
  # Approximation to estimate Effect Size
  levIS<-paste0("T",1:C)
  EffS<-parallel::mclapply(1:C, function(x) WRS2::yuen(get(levIS[x])~Sleep,data=DatPas[[1]])[6],
                           mc.cores = parallel::detectCores(), mc.allow.recursive = TRUE)
  ConEntre.2.b2<-round(data.table(unlist(EffS)),Prc)
  ConEntre.2.b3<-data.table(Contr=c("Sleep on M1", "Sleep on M2", "Sleep on M3",
                                    "Sleep on M4", "Sleep on M5"),ConEntre.2.b1,EfSize=ConEntre.2.b2)
  
  # Learning (successive Time/Trial/Moment) on BC
  cnMM.Ap2<-ContCAll(A=2,B=2,C=5,"Succ.BC") #ContBC.5Learn
  Contr.1Ap2<-rmmcp(DatPas[[2]],con=cnMM.Ap2)
  ConEntre.b1Ap2<-round(as.data.table(cbind( Contr.1Ap2$test, Contr.1Ap2$psihat)),Prc)[,.(psihat,df,test,p.value)]
  ConEntre.b1Ap2$p.value <-round(Contr.1Ap2$test[,3],4)
  
  # Approximation to estimate Effect Size
  LosLv<-split(c(rep("T1",2),rep("T2",2),rep("T3",2),rep("T4",2),rep("T2",2),rep("T3",2),rep("T4",2),rep("T5",2)),1:8)
  LosLv2<-rep(levels(DatPas[[1]]$Sleep),4)
  EffSAp<- parallel::mclapply(1:8, function(x)   yuendv2(DatPas[[1]][Sleep==LosLv2[x],get(LosLv[[x]][1])],
                                               DatPas[[1]][Sleep==LosLv2[x],get(LosLv[[x]][2])])$Effect.Size,
                              mc.cores = parallel::detectCores(), mc.allow.recursive = TRUE)
  ConEntre.b2Ap2<-round(data.table(unlist(EffSAp)),Prc)
  ConEntre.b3Ap2<-data.table(Contr=c("M1-M2 on Young", "M1-M2 on Old", "M2-M3 on Young", "M2-M3 on Old",
                                    "M3-M4 on Young", "M3-M4 on Old", "M4-M5 on Young", "M4-M5 on Old"),
                             ConEntre.b1Ap2,EfSize=ConEntre.b2Ap2)
  ConEntre.b3Ap2<-ConEntre.b3Ap2[,-3]
  ConEntre.b3Ap2<-ConEntre.b3Ap2[,.(Contr,psihat,df=NA,test, p.value ,EfSize.V1)]
  ConEntre.b3.Funde2<-rbind(ConEntre.2.b3,ConEntre.b3Ap2)
  ExFin$InterBC<-as.data.table(ConEntre.b3.Funde2)
  
  # 5) Main Effect of C (Trial/Moment/Time)
  cnMM<-ContCAll(A=2,B=2,C=5,"Succ") #ContC.5
  Contr.1<-rmmcp(DatPas[[2]],con=cnMM)
  Contr.1b<-rmmismcp(DatPas[[2]],con=cnMM)
  ConEntre.b1<-round(as.data.table(cbind(Contr.1$test,Contr.1$psihat)),Prc)[,.(psihat,df,test,p.value)]
  ConEntre.b1$p.value <-round(Contr.1$test[,3],4)
  ConEntre.b1b<-as.data.table(cbind(round(Contr.1b$output[,2],Prc), round(Contr.1b$output[,3],4)))
  names(ConEntre.b1b)<-c("Psihat2","p.value2")
  ContrFunde<-cbind(ConEntre.b1,ConEntre.b1b)
  ContrFunde<-ContrFunde[,-2]
  ConEntre.b3Ap<-ContrFunde[,.(psihat,df=NA,test, p.value,Psihat2, p.value2)]
      
  # Approximation to estimate Effect Size
  LosLv<-split(c("T1","T2","T3","T4","T2","T3","T4","T5"),1:4)
  EffSAp2<- parallel::mclapply(1:4, function(x) yuendv2(DatPas[[1]][,get(LosLv[[x]][1])],DatPas[[1]][,get(LosLv[[x]][2])])$Effect.Size,
                               mc.cores = parallel::detectCores(), mc.allow.recursive = TRUE)
  ConEntre.b2<-round(data.table(unlist(EffSAp2)),Prc)
  ConEntre.b3<-data.table(Contr=c("M1-M2", "M2-M3", "M3-M4", "M4-M5"),ContrFunde,EfSize=ConEntre.b2)
  ExFin$DetallMainC<-ConEntre.b3
  
  # 6) Learning (successive Trial/Moment/time) on AB (each experimental condition)
  cnMM.Ap<-ContCAll(A=2,B=2,C=5,"Succ.EfS") #ContABC.5Learn
  Contr.1<-rmmcp(DatPas[[2]],con=cnMM.Ap)
  Contr.1b<-rmmismcp(DatPas[[2]],con=cnMM.Ap)
  ConEntre.b1<-round(as.data.table(cbind(Contr.1$test,Contr.1$psihat)),Prc)[,.(psihat,df,test,p.value)]
  ConEntre.b1$p.value <-round(Contr.1$test[,3],4)
  ConEntre.b1b<-as.data.table(cbind(round(Contr.1b$output[,2],Prc), round(Contr.1b$output[,3],4)))
  names(ConEntre.b1b)<-c("Psihat2","p.value2")
  ContrFunde<-cbind(ConEntre.b1,ConEntre.b1b)
  
  DtIntra<-copy(DatPas[[1]]);
  DtIntra[,Inter:=interaction(Age,Sleep)]
  DtIntra$Inter<-factor(DtIntra$Inter,levels=c("Young.Control", "Young.SR", "Old.Control","Old.SR"))
  AExtr<-c("dif","df","teststat","Effect.Size","p.value")
  LosLv<-split(c(rep("T1",4),rep("T2",4),rep("T3",4),rep("T4",4),rep("T2",4),rep("T3",4),rep("T4",4),rep("T5",4)),1:16)
  LosLv2<-rep(levels(DtIntra$Inter),4)
  EffSApC<- parallel::mclapply(1:16, function(x)   yuendv2(DtIntra[Inter==LosLv2[x],get(LosLv[[x]][1])],
                                               DtIntra[Inter==LosLv2[x],get(LosLv[[x]][2])])
                                                [AExtr],
                               mc.cores = parallel::detectCores(), mc.allow.recursive = TRUE)
  TestContr2<-data.table(do.call(rbind, setNames(EffSApC,AExtr)))
  ConEntre.b3Ap<-data.table(Contr=c("M1-M2 on Y_C", "M1-M2 on Y_SR", "M1-M2 on O_C", "M1-M2 on O_SR",
                                      "M2-M3 on Y_C", "M2-M3 on Y_SR", "M2-M3 on O_C", "M2-M3 on O_SR",
                                      "M3-M4 on Y_C", "M3-M4 on Y_SR", "M3-M4 on O_C", "M3-M4 on O_SR",
                                     "M4-M5 on Y_C", "M4-M5 on Y_SR", "M4-M5 on O_C", "M4-M5 on O_SR"),
                              ContrFunde)
    ConEntre.b3Ap<-ConEntre.b3Ap[,-3]
    ConEntre.b3Ap<-ConEntre.b3Ap[,.(Contr,psihat,df=NA,test, p.value,Psihat2, p.value2)]
    rrF<-data.table(ConEntre.b3Ap,dif.yuen=round(unlist(TestContr2[,1]),Prc),df.yuen=unlist(TestContr2[,2]),
                    test.yuen=round(unlist(TestContr2[,3]),Prc),EffSize.yuen=round(unlist(TestContr2[,4]),Prc),
                    pvaluet.yuen=round(unlist(TestContr2[,5]),4))
    ExFin$DetallTrialCadaCondAB<-rrF
    
    # 7) Simple Simple Effect AxB on each Trial/Time/Moment
    ExFin$DetallSimple<-parallel::mclapply(1:C, function (is) AOVBwF(2,2,DatPas = DatEfSp[[is]],nBMM2),
                                           mc.cores = parallel::detectCores(), mc.allow.recursive = TRUE)  
    
    return(ExFin)
  }
  
  AlmacenGen<-function(GrpP,Grp2P=GrpP,DataPas, PathDesignP, NmBasP,Typ=1){
    NmFAl<-paste0(PathDesignP,NmBasP)
    if (!dir.exists(NmFAl)) {dir.create(NmFAl)}
    NmFAl<-paste0(NmFAl,"/")
    
    pdf(paste0(NmFAl,NmBasP,".pdf"),family = "ArialMT")
      plot(GrpP)
    dev.off()
    pdf(paste0(NmFAl,NmBasP,"_Asterisk.pdf"),family = "ArialMT")
      plot(Grp2P)
    dev.off()
    png(paste0(NmFAl,NmBasP,".png"),width = 1200, height = 1000,family = "ArialMT")
      plot(GrpP)
    dev.off()
    png(paste0(NmFAl,NmBasP,"_Asterisk.png"),width = 1200, height = 1000,family = "ArialMT")
      plot(Grp2P)
    dev.off()
  
    
    rtffile <- RTF(paste0(NmFAl,NmBasP,"AllStats.doc"))
    if (length(DataPas)<2 & Typ==1){
        write.csv2(as.data.table(DataPas[[1]]),paste0(NmFAl,NmBasP,"ResStat",1,"_",names(DataPas)[1],".csv"))
        addText(rtffile,paste0("Overall_",names(DataPas)[1]))
        addNewLine(rtffile)
        addTable(rtffile, as.data.table(DataPas[[1]]));
        addNewLine(rtffile)
    }
    if (length(DataPas)>2 & Typ==2){
      for (i in 1:3) {
        write.csv2(as.data.table(DataPas[[i]]),paste0(NmFAl,NmBasP,"ResStat",i,"_",names(DataPas)[i],".csv"))
        addText(rtffile,paste0("Overall_",names(DataPas)[i]))
        addNewLine(rtffile)
        addTable(rtffile, as.data.table(DataPas[[i]]));
        addNewLine(rtffile)  
      }
    }
    
    cont<-3
    if (length(DataPas)>2 & Typ==1){
      for (i in 1:length(DataPas)) {
        write.csv2(as.data.table(DataPas[[i]]),paste0(NmFAl,NmBasP,"ResStat",i,"_",names(DataPas)[i],".csv"))
        addText(rtffile,paste0("Overall_",names(DataPas)[i]))
        addNewLine(rtffile)
        addTable(rtffile, as.data.table(DataPas[[i]]));
        addNewLine(rtffile)
      }
    }
    if (length(DataPas)>2 & Typ==2){
      for (j in 1:length(DataPas[[4]])) {
        for (k in 1:length(DataPas[[4]][[j]])) {
          cont<-cont+1
          write.csv2(as.data.table(DataPas[[4]][[j]][[k]]),paste0(NmFAl,NmBasP,"ResStat",cont,"_Cond",j,
                                                                  names(DataPas[[4]][[j]])[k],".csv"))
          addText(rtffile,paste0("Simple Effect A*B on Time_","_Cond",j,names(DataPas[[4]][[j]])[k]))
          addNewLine(rtffile)
          addTable(rtffile, as.data.table(DataPas[[4]][[j]][[k]]));
          addNewLine(rtffile)
        }
      }
    }
    addPlot(rtffile,plot.fun=print,width=6,height=6,res=600, GrpP)
    addNewLine(rtffile)
    addPlot(rtffile,plot.fun=print,width=6,height=6,res=600, Grp2P)
    done(rtffile)
  }
  
  AlmacenGen2<-function(GrpP,Grp2P=GrpP,DataPas, PathDesignP, NmBasP,Typ=1){
    NmFAl<-paste0(PathDesignP,NmBasP)
    if (!dir.exists(NmFAl)) {dir.create(NmFAl)}
    NmFAl<-paste0(NmFAl,"/")
    
    pdf(paste0(NmFAl,NmBasP,".pdf"),family = "ArialMT")
      plot(GrpP)
    dev.off()
    pdf(paste0(NmFAl,NmBasP,"_Asterisk.pdf"),family = "ArialMT")
      plot(Grp2P)
    dev.off()
    png(paste0(NmFAl,NmBasP,".png"),width = 1200, height = 1000,family = "ArialMT")
      plot(GrpP)
    dev.off()
    png(paste0(NmFAl,NmBasP,"_Asterisk.png"),width = 1200, height = 1000,family = "ArialMT")
      plot(Grp2P)
    dev.off()
  
    
    rtffile <- RTF(paste0(NmFAl,NmBasP,"AllStats.doc"))
    if (length(DataPas)<2 & Typ==1){
        write.csv2(as.data.table(DataPas[[1]]),paste0(NmFAl,NmBasP,"ResStat",1,"_",names(DataPas)[1],".csv"))
        addText(rtffile,paste0("Overall_",names(DataPas)[1]))
        addNewLine(rtffile)
        addTable(rtffile, as.data.table(DataPas[[1]]));
        addNewLine(rtffile)
    }
    if (length(DataPas)>2 & Typ==2){
      for (i in 1:6) {
        write.csv2(as.data.table(DataPas[[i]]),paste0(NmFAl,NmBasP,"ResStat",i,"_",names(DataPas)[i],".csv"))
        addText(rtffile,paste0("Overall_",names(DataPas)[i]))
        addNewLine(rtffile)
        addTable(rtffile, as.data.table(DataPas[[i]]));
        addNewLine(rtffile)  
      }
    }
    
    cont<-6
    if (length(DataPas)>2 & Typ==1){
      for (i in 3:length(DataPas)) {
        write.csv2(as.data.table(DataPas[[i]]),paste0(NmFAl,NmBasP,"ResStat",i,"_",names(DataPas)[i],".csv"))
        addText(rtffile,paste0("Overall_",names(DataPas)[i]))
        addNewLine(rtffile)
        addTable(rtffile, as.data.table(DataPas[[i]]));
        addNewLine(rtffile)
      }
    }
    if (length(DataPas)>2 & Typ==2){
      for (j in 1:length(DataPas[[7]])) {
        for (k in 1:length(DataPas[[7]][[j]])) {
          cont<-cont+1
          write.csv2(as.data.table(DataPas[[7]][[j]][[k]]),paste0(NmFAl,NmBasP,"ResStat",cont,"_Cond",j,
                                                                  names(DataPas[[7]][[j]])[k],".csv"))
          addText(rtffile,paste0("Simple Effect A*B on Time_","_Cond",j,names(DataPas[[7]][[j]])[k]))
          addNewLine(rtffile)
          addTable(rtffile, as.data.table(DataPas[[7]][[j]][[k]]));
          addNewLine(rtffile)
        }
      }
    }
    addPlot(rtffile,plot.fun=print,width=6,height=6,res=600, GrpP)
    addNewLine(rtffile)
    addPlot(rtffile,plot.fun=print,width=6,height=6,res=600, Grp2P)
    done(rtffile)
  }
  
  AlmacenGen3<-function(GrpP,Grp2P=GrpP,DataPas, PathDesignP, NmBasP,Typ=1){
    NmFAl<-paste0(PathDesignP,NmBasP)
    if (!dir.exists(NmFAl)) {dir.create(NmFAl)}
    NmFAl<-paste0(NmFAl,"/")
    
    rtffile <- RTF(paste0(NmFAl,NmBasP,"AllStats.doc"))
    if (length(DataPas)<2 & Typ==1){
        write.csv2(as.data.table(DataPas[[1]]),paste0(NmFAl,NmBasP,"ResStat",1,"_",names(DataPas)[1],".csv"))
        addText(rtffile,paste0("Overall_",names(DataPas)[1]))
        addNewLine(rtffile)
        addTable(rtffile, as.data.table(DataPas[[1]]));
        addNewLine(rtffile)
    }
    if (length(DataPas)>2 & Typ==2){
      for (i in 1:6) {
        write.csv2(as.data.table(DataPas[[i]]),paste0(NmFAl,NmBasP,"ResStat",i,"_",names(DataPas)[i],".csv"))
        addText(rtffile,paste0("Overall_",names(DataPas)[i]))
        addNewLine(rtffile)
        addTable(rtffile, as.data.table(DataPas[[i]]));
        addNewLine(rtffile)  
      }
    }
    
    cont<-6
    if (length(DataPas)>2 & Typ==1){
      for (i in 3:length(DataPas)) {
        write.csv2(as.data.table(DataPas[[i]]),paste0(NmFAl,NmBasP,"ResStat",i,"_",names(DataPas)[i],".csv"))
        addText(rtffile,paste0("Overall_",names(DataPas)[i]))
        addNewLine(rtffile)
        addTable(rtffile, as.data.table(DataPas[[i]]));
        addNewLine(rtffile)
      }
    }
    if (length(DataPas)>2 & Typ==2){
      for (j in 1:length(DataPas[[7]])) {
        for (k in 1:length(DataPas[[7]][[j]])) {
          cont<-cont+1
          write.csv2(as.data.table(DataPas[[7]][[j]][[k]]),paste0(NmFAl,NmBasP,"ResStat",cont,"_Cond",j,
                                                                  names(DataPas[[7]][[j]])[k],".csv"))
          addText(rtffile,paste0("Simple Effect A*B on Time_","_Cond",j,names(DataPas[[7]][[j]])[k]))
          addNewLine(rtffile)
          addTable(rtffile, as.data.table(DataPas[[7]][[j]][[k]]));
          addNewLine(rtffile)
        }
      }
    }
    done(rtffile)
  }
  
  Kbl3<-function(ResPas,lbl) {
      ResPas %>%
      kbl(caption = lbl,digits=4,escape = F, align = "c")  %>%
      kable_paper("hover", bootstrap_options = c("striped", "hover", "condensed", "responsive"),full_width = F,font_size = 10)
    }
    # Results
    plot(Grp)
    plot(Grp2) # Only this graph is printed in the html file.
    ResGen  # Lean option to view the results of statistical analysis
    
    Kbl3(ResGen[[1]], "Omnibus AOV. Design 2x2");cat("\n")
    Kbl3(ResGen[[2]], "Simple Effects Age-Sleep. Design 2x2")
    Kbl3(ResGen[[3]], "Extense Simple Effects Age-Sleep. Design 2x2")
    # Results
    plot(Grp)
    plot(Grp2) # Only this graph is printed in the html file.
    ResGen  # Lean option to view the results of statistical analysis
    
    Kbl3(ResGen[[1]], "Omnibus AOV. Design 2x(5xS)");cat("\n")
    Kbl3(ResGen[[2]], "Simple Effects Age-Time. Design 2x(5xS)")
    Kbl3(ResGen[[3]], "Main Effects of Time. Design 2x(5xS)")
    # Results
    plot(Grp)
    plot(Grp2) # Only this graph is printed in the html file.
    GrpO
    plot(Grp3)
    ResGen # Lean option to view the results of statistical analysis
    
    Kbl3(ResPas = ResGen[[1]], lbl = "Omnibus AOV. Design 2x2x(4xS)");cat("\n")
    Kbl3(ResGen[[2]], "Interaction Age-Sleep. Design 2x2x(4xS)")
    Kbl3(ResGen[[3]], "Interaction Age-Time. Design 2x2x(4xS)")
    Kbl3(ResGen[[4]], "Interaction Sleep-Time. Design 2x2x(4xS)")
    Kbl3(ResGen[[5]], "Main Effect Time. Design 2x2x(4xS)")
    Kbl3(ResGen[[6]], "Simple Effect Time each Age-Sleep condition. Design 2x2x(4xS)")
    Kbl3(ResGen[[7]][[1]][[1]], "Simple Effect Age-Sleep on Time=1 Omnibus AOV. Design 2x2x(4xS)")
    Kbl3(ResGen[[7]][[1]][[2]], "Simple Effect Age-Sleep on Time=1 Simple Effects. Design 2x2x(4xS)")
    Kbl3(ResGen[[7]][[1]][[3]], "Simple Effect Age-Sleep on Time=1 Extense Simple Effects. Design 2x2x(4xS)")
    Kbl3(ResGen[[7]][[2]][[1]], "Simple Effect Age-Sleep on Time=2 Omnibus AOV. Design 2x2x(4xS)")
    Kbl3(ResGen[[7]][[2]][[2]], "Simple Effect Age-Sleep on Time=2 Simple Effects. Design 2x2x(4xS)")
    Kbl3(ResGen[[7]][[2]][[3]], "Simple Effect Age-Sleep on Time=2 Extense Simple Effects. Design 2x2x(4xS)")
    Kbl3(ResGen[[7]][[3]][[1]], "Simple Effect Age-Sleep on Time=3 Omnibus AOV. Design 2x2x(4xS)")
    Kbl3(ResGen[[7]][[3]][[2]], "Simple Effect Age-Sleep on Time=3 Simple Effects. Design 2x2x(4xS)")
    Kbl3(ResGen[[7]][[3]][[3]], "Simple Effect Age-Sleep on Time=3 Extense Simple Effects. Design 2x2x(4xS)")
    Kbl3(ResGen[[7]][[4]][[1]], "Simple Effect Age-Sleep on Time=4 Omnibus AOV. Design 2x2x(4xS)")
    Kbl3(ResGen[[7]][[4]][[2]], "Simple Effect Age-Sleep on Time=4 Simple Effects. Design 2x2x(4xS)")
    Kbl3(ResGen[[7]][[4]][[3]], "Simple Effect Age-Sleep on Time=4 Extense Simple Effects. Design 2x2x(4xS)")
    # Results
    plot(Grp)
    plot(Grp2) # Only this graph is printed in the html file.
    GrpO
    plot(Grp3)
    ResGen # Lean option to view the results of statistical analysis
    
    Kbl3(ResPas = ResGen[[1]], lbl = "Omnibus AOV. Design 2x2x(5xS)");cat("\n")
    Kbl3(ResGen[[2]], "Interaction Age-Sleep. Design 2x2x(5xS)")
    Kbl3(ResGen[[3]], "Interaction Age-Time. Design 2x2x(5xS)")
    Kbl3(ResGen[[4]], "Interaction Sleep-Time. Design 2x2x(5xS)")
    Kbl3(ResGen[[5]], "Main Effect Time. Design 2x2x(5xS)")
    Kbl3(ResGen[[6]], "Simple Effect Time each Age-Sleep condition. Design 2x2x(5xS)")
    Kbl3(ResGen[[7]][[1]][[1]], "Simple Effect Age-Sleep on Time=1 Omnibus AOV. Design 2x2x(5xS)")
    Kbl3(ResGen[[7]][[1]][[2]], "Simple Effect Age-Sleep on Time=1 Simple Effects. Design 2x2x(5xS)")
    Kbl3(ResGen[[7]][[1]][[3]], "Simple Effect Age-Sleep on Time=1 Extense Simple Effects. Design 2x2x(5xS)")
    Kbl3(ResGen[[7]][[2]][[1]], "Simple Effect Age-Sleep on Time=2 Omnibus AOV. Design 2x2x(5xS)")
    Kbl3(ResGen[[7]][[2]][[2]], "Simple Effect Age-Sleep on Time=2 Simple Effects. Design 2x2x(5xS)")
    Kbl3(ResGen[[7]][[2]][[3]], "Simple Effect Age-Sleep on Time=2 Extense Simple Effects. Design 2x2x(5xS)")
    Kbl3(ResGen[[7]][[3]][[1]], "Simple Effect Age-Sleep on Time=3 Omnibus AOV. Design 2x2x(5xS)")
    Kbl3(ResGen[[7]][[3]][[2]], "Simple Effect Age-Sleep on Time=3 Simple Effects. Design 2x2x(5xS)")
    Kbl3(ResGen[[7]][[3]][[3]], "Simple Effect Age-Sleep on Time=3 Extense Simple Effects. Design 2x2x(5xS)")
    Kbl3(ResGen[[7]][[4]][[1]], "Simple Effect Age-Sleep on Time=4 Omnibus AOV. Design 2x2x(5xS)")
    Kbl3(ResGen[[7]][[4]][[2]], "Simple Effect Age-Sleep on Time=4 Simple Effects. Design 2x2x(5xS)")
    Kbl3(ResGen[[7]][[4]][[3]], "Simple Effect Age-Sleep on Time=4 Extense Simple Effects. Design 2x2x(5xS)")
    Kbl3(ResGen[[7]][[5]][[1]], "Simple Effect Age-Sleep on Time=5 Omnibus AOV. Design 2x2x(5xS)")
    Kbl3(ResGen[[7]][[5]][[2]], "Simple Effect Age-Sleep on Time=5 Simple Effects. Design 2x2x(5xS)")
    Kbl3(ResGen[[7]][[5]][[3]], "Simple Effect Age-Sleep on Time=5 Extense Simple Effects. Design 2x2x(5xS)")
    # Results
    plot(Grp)
    plot(Grp2) # Only this graph is printed in the html file.
    ResGen  # Lean option to view the results of statistical analysis
    
    Kbl3(ResGen[[1]], "Omnibus AOV Design 2x(4xS)");cat("\n")
    Kbl3(ResGen[[2]], "Simple Effects Age-Time Design 2x(4xS)")
    Kbl3(ResGen[[3]], "Main Effects Time Design 2x(4xS)")
    # Results
    plot(Grp)
    plot(Grp2) # Only this graph is printed in the html file.
    plot(Grp3)
    GrpO
    ResGen # Lean option to view the results of statistical analysis
    
    Kbl3(ResPas = ResGen[[1]], lbl = "Omnibus AOV. Design 2x2x(2xS)");cat("\n")
    Kbl3(ResGen[[2]], "Interaction Age-Sleep. Design 2x2x(2xS)")
    Kbl3(ResGen[[3]], "Interaction Age-Time. Design 2x2x(2xS)")
    Kbl3(ResGen[[4]], "Interaction Sleep-Time. Design 2x2x(2xS)")
    Kbl3(ResGen[[5]], "Main Effect Time. Design 2x2x(2xS)")
    Kbl3(ResGen[[6]], "Simple Effect Time each Age-Sleep condition. Design 2x2x(2xS)")
    Kbl3(ResGen[[7]][[1]][[1]], "Simple Effect Age-Sleep on Time=1 Omnibus AOV. Design 2x2x(2xS)")
    Kbl3(ResGen[[7]][[1]][[2]], "Simple Effect Age-Sleep on Time=1 Simple Effects. Design 2x2x(2xS)")
    Kbl3(ResGen[[7]][[1]][[3]], "Simple Effect Age-Sleep on Time=1 Extense Simple Effects. Design 2x2x(2xS)")
    Kbl3(ResGen[[7]][[2]][[1]], "Simple Effect Age-Sleep on Time=2 Omnibus AOV. Design 2x2x(2xS)")
    Kbl3(ResGen[[7]][[2]][[2]], "Simple Effect Age-Sleep on Time=2 Simple Effects. Design 2x2x(2xS)")
    Kbl3(ResGen[[7]][[2]][[3]], "Simple Effect Age-Sleep on Time=2 Extense Simple Effects. Design 2x2x(2xS)")

2 Figure 1. Object place recognition (OPR) behavioral performance


Figure 1. Object place recognition (OPR) behavioral performance. A) Schematic of behavioral design. B) Percent change in preference for displaced object [number of animals (n): young control (YC): n=16, young SD (YSD): n=15, old control (OC): n=13, old SD (OSD): n=15]. C) Percent change in preference for the unmoved objects. D) Total time of object exploration during training and testing in seconds (s). E) Percent change in preference for displaced object excluding trial 1. F) Percent change in preference for displaced object in young (n=7) and old (n=7) mice receiving delayed SD, 5 hr after training (YSD: n=6, OSD: n=7). G) Levels of plasma corticosterone in control (young: n=5; old: n=5) and SD (young: n=5; old: n=6) mice. In all Figures data are graphed using Box Plots according to robust statistics based on the median. The inner line corresponds to the median, the lower box represents the first quartile, the upper box the third quartile, and the extending lines, known as whiskers, represent the minimum and maximum, showing the extent of variability. The diamond represents the trimmed mean (e.g., adjusted average without outliers) used for analysis, which was set at 0.2, according to robust statistics recommendations (Wilcox, 2012) for all age groups and sleep conditions. T1-T3: training trials. Asterisks (*) represent significance using alpha=0.05. Statistical details in Supplemental Statistical Table corresponding to Figure 1.


2.1 Fig 1B Percent change in preference for displaced object {Design 2x2}

  NmBas="Fig1B OPR"
  ResGen<-NA

  rrt<-ExData.2(nmF = paste0(PathDesign,"OPR.csv"),Vars = c(1:3))
  DatDT<-rrt$DT
  ArP<-rrt$Arp
  
  #Graphs 
  Grp<- Grph.2(DatDT,"OPR",LblsP =c("Preference for Displaced Object", "","% Change in Object Preference"),c(-40,50),T)

  Grp2<- Grp + geom_signif(annotation="*",
              y_position=50, xmin=1  , xmax=2, 
              tip_length = c(0.02, 0.02),vjust=0.5,textsize=10) +
    geom_signif(annotation="*",
              y_position=40, xmin=3  , xmax=4, 
              tip_length = c(0.02, 0.02),vjust=0.5,textsize=10)+
    geom_signif(annotation="*",
              y_position=35, xmin=1  , xmax=3, 
              tip_length = c(0.02, 0.02),vjust=0.5,textsize=10)+
    geom_signif(annotation="*",
              y_position=45, xmin=2  , xmax=4, 
              tip_length = c(0.02, 0.02),vjust=0.5,textsize=10)
    
    # AOV & Simple Effects
    names(rrt$DT)[3]<-"DepV"
    ResGen<-AOVBwF(2,2,DatPas = rrt,nBMM = 10000)
    AlmacenGen(Grp,Grp2,ResGen,PathDesign,NmBas,Typ=1)
    
        # Results
        plot(Grp)
        plot(Grp2) # Only this graph is printed in the html file.
        ResGen  # Lean option to view the results of statistical analysis
        
        Kbl3(ResGen[[1]], "Omnibus AOV. Design 2x2");cat("\n")
        Kbl3(ResGen[[2]], "Simple Effects Age-Sleep. Design 2x2")
        Kbl3(ResGen[[3]], "Extense Simple Effects Age-Sleep. Design 2x2")
[1] "Taking bootstrap samples. Please wait."
          Eff   p.V1 p.Sig
1:  A.p.value 0.4007      
2:  B.p.value 0.4691      
3: AB.p.value 0.0000 *    
[1] "Taking bootstrap samples. Please wait."
          Eff   p.V1 p.Sig
1:  A.p.value 0.3988      
2:  B.p.value 0.4566      
3: AB.p.value 0.0011 *    
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
$AOV
       Names     Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot   Sig pBootMas
1:       Age  0.71 0.405   0.71  0.405  0.53 0.4688 0.4007         0.3988
2:     Sleep  0.56 0.460   0.56  0.460  0.05 0.8283 0.4691         0.4566
3: Age*Sleep 14.86 0.001  -0.55  0.000 17.51 0.0001 0.0000 *       0.0011
   SigMas EffSize
1:           0.10
2:           0.11
3:  *        0.86

$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  17.74 16.07  3.39  0.0037      0.67     11.51 0.0111
2:   Sleep on Old -11.97 15.10 -2.11  0.0516      0.70      4.47 0.0544
3: Age on Control  11.60 17.41  2.44  0.0256      0.53      5.96 0.0189
4:      Age on SR -18.11 15.89 -2.98  0.0088      0.71      8.91 0.0044
   EffSize.Boot
1:         0.68
2:         0.71
3:         0.52
4:         0.71

$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  17.74 16.07  3.39  0.0037      0.67     11.51 0.0089
2:   Sleep on Old -11.97 15.10 -2.11  0.0516      0.70      4.47 0.0633
3: Age on Control  11.60 17.41  2.44  0.0256      0.53      5.96 0.0356
4:      Age on SR -18.11 15.89 -2.98  0.0088      0.71      8.91 0.0167
5:      YSR vs OC  -6.14 15.58 -1.14  0.2711      0.25      1.30 0.2567
   EffSize.Boot
1:         0.67
2:         0.69
3:         0.53
4:         0.71
5:         0.25
Omnibus AOV. Design 2x2
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.71 0.405 0.71 0.405 0.53 0.4688 0.4007 0.3988 0.10
Sleep 0.56 0.460 0.56 0.460 0.05 0.8283 0.4691 0.4566 0.11
Age*Sleep 14.86 0.001 -0.55 0.000 17.51 0.0001 0.0000
0.0011
0.86
Simple Effects Age-Sleep. Design 2x2
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 17.74 16.07 3.39 0.0037 0.67 11.51 0.0111 0.68
Sleep on Old -11.97 15.10 -2.11 0.0516 0.70 4.47 0.0544 0.71
Age on Control 11.60 17.41 2.44 0.0256 0.53 5.96 0.0189 0.52
Age on SR -18.11 15.89 -2.98 0.0088 0.71 8.91 0.0044 0.71
Extense Simple Effects Age-Sleep. Design 2x2
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 17.74 16.07 3.39 0.0037 0.67 11.51 0.0089 0.67
Sleep on Old -11.97 15.10 -2.11 0.0516 0.70 4.47 0.0633 0.69
Age on Control 11.60 17.41 2.44 0.0256 0.53 5.96 0.0356 0.53
Age on SR -18.11 15.89 -2.98 0.0088 0.71 8.91 0.0167 0.71
YSR vs OC -6.14 15.58 -1.14 0.2711 0.25 1.30 0.2567 0.25

2.2 Fig 1C Percent change in preference for the unmoved objects {Design 2x2}

  NmBas="Fig1C PreferenceUnmoved"
  ResGen<-NA
  
  rrt<-ExData.2(nmF = paste0(PathDesign,"Preference.csv"),Vars = c(1:3))
  DatDT<-rrt$DT
  ArP<-rrt$Arp
  
  #Graphs
  Grp<- Grph.2(DatDT,"Preference",LblsP =c("Preference for Unmoved Objects", "","% Change in Object Preference"),c(-25,25),T)
  
  Grp2<- Grp + geom_signif(annotation="*",
              y_position=17, xmin=1  , xmax=2, 
              tip_length = c(0.02, 0.02),vjust=0.5,textsize=10) +
    geom_signif(annotation="*",
              y_position=12, xmin=3  , xmax=4, 
              tip_length = c(0.02, 0.02),vjust=0.5,textsize=10)+
    geom_signif(annotation="*",
              y_position=10, xmin=1  , xmax=3, 
              tip_length = c(0.02, 0.02),vjust=0.5,textsize=10)+
    geom_signif(annotation="*",
              y_position=15, xmin=2  , xmax=4, 
              tip_length = c(0.02, 0.02),vjust=0.5,textsize=10)
  
  
    # AOV & Simple Effects
    names(rrt$DT)[3]<-"DepV"
    ResGen<-AOVBwF(2,2,DatPas = rrt,nBMM = 10000)
    AlmacenGen(Grp,Grp2,ResGen,PathDesign,NmBas,Typ=1)
    
        # Results
        plot(Grp)
        plot(Grp2) # Only this graph is printed in the html file.
        ResGen  # Lean option to view the results of statistical analysis
        
        Kbl3(ResGen[[1]], "Omnibus AOV. Design 2x2");cat("\n")
        Kbl3(ResGen[[2]], "Simple Effects Age-Sleep. Design 2x2")
        Kbl3(ResGen[[3]], "Extense Simple Effects Age-Sleep. Design 2x2")
[1] "Taking bootstrap samples. Please wait."
          Eff   p.V1 p.Sig
1:  A.p.value 0.4007      
2:  B.p.value 0.4691      
3: AB.p.value 0.0000 *    
[1] "Taking bootstrap samples. Please wait."
          Eff   p.V1 p.Sig
1:  A.p.value 0.3898      
2:  B.p.value 0.4581      
3: AB.p.value 0.0006 *    
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
$AOV
       Names     Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot   Sig pBootMas
1:       Age  0.71 0.405   0.71  0.405  0.53 0.4688 0.4007         0.3898
2:     Sleep  0.56 0.460   0.56  0.460  0.05 0.8283 0.4691         0.4581
3: Age*Sleep 14.86 0.001   0.55  0.000 17.51 0.0001 0.0000 *       0.0006
   SigMas EffSize
1:           0.10
2:           0.11
3:  *        0.86

$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -8.87 16.07 -3.39  0.0037      0.67     11.51 0.0044
2:   Sleep on Old   5.98 15.10  2.11  0.0516      0.71      4.47 0.0500
3: Age on Control  -5.80 17.41 -2.44  0.0256      0.53      5.96 0.0367
4:      Age on SR   9.06 15.89  2.98  0.0088      0.71      8.91 0.0056
   EffSize.Boot
1:         0.67
2:         0.71
3:         0.55
4:         0.71

$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -8.87 16.07 -3.39  0.0037      0.68     11.51 0.0089
2:   Sleep on Old   5.98 15.10  2.11  0.0516      0.70      4.47 0.0578
3: Age on Control  -5.80 17.41 -2.44  0.0256      0.52      5.96 0.0333
4:      Age on SR   9.06 15.89  2.98  0.0088      0.71      8.91 0.0078
5:      YSR vs OC   3.07 15.58  1.14  0.2711      0.25      1.30 0.2567
   EffSize.Boot
1:         0.68
2:         0.70
3:         0.52
4:         0.71
5:         0.25
Omnibus AOV. Design 2x2
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.71 0.405 0.71 0.405 0.53 0.4688 0.4007 0.3898 0.10
Sleep 0.56 0.460 0.56 0.460 0.05 0.8283 0.4691 0.4581 0.11
Age*Sleep 14.86 0.001 0.55 0.000 17.51 0.0001 0.0000
0.0006
0.86
Simple Effects Age-Sleep. Design 2x2
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -8.87 16.07 -3.39 0.0037 0.67 11.51 0.0044 0.67
Sleep on Old 5.98 15.10 2.11 0.0516 0.71 4.47 0.0500 0.71
Age on Control -5.80 17.41 -2.44 0.0256 0.53 5.96 0.0367 0.55
Age on SR 9.06 15.89 2.98 0.0088 0.71 8.91 0.0056 0.71
Extense Simple Effects Age-Sleep. Design 2x2
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -8.87 16.07 -3.39 0.0037 0.68 11.51 0.0089 0.68
Sleep on Old 5.98 15.10 2.11 0.0516 0.70 4.47 0.0578 0.70
Age on Control -5.80 17.41 -2.44 0.0256 0.52 5.96 0.0333 0.52
Age on SR 9.06 15.89 2.98 0.0088 0.71 8.91 0.0078 0.71
YSR vs OC 3.07 15.58 1.14 0.2711 0.25 1.30 0.2567 0.25

2.3 Fig 1D Total time of object exploration during training and testing in seconds (s) {Design 2x2x(4xS)}

  NmBas="Fig1D ObjectExploration"
  NmFAlL<-paste0(PathDesign,NmBas)
  if (!dir.exists(NmFAlL)) {dir.create(NmFAlL)}
  NmFAlL<-paste0(NmFAlL,"/")
  ResGen<-NA
  
  rrt<-ExDataIS.2(nmF = paste0(PathDesign,"Exploration Final.csv"),Vars = c(1:7),vIntP =c(4:7),lvlCh = list("T1"="T1","T2"="T2","T3"="T3","Test"="Test" ))
  DatDT<-rrt$DT
  ArP<-rrt$Arp
  ExtendDT<-rrt$ExtendDT
  
  # Simple Effects:
  DatEfS<-list()
  for(is in 1:4) {
    DatEfS[[is]]<-ExData.2(nmF = paste0(PathDesign,"Exploration Final.csv"),Vars = c(1:2,(3+is)))
    names(DatEfS[[is]]$DT)[3]<-"DepV"
  }
  
  #Graphs
  Grp<- Grph.3(DatP = ExtendDT,"OPR",LblsP =c("Object Exploration", "","Total Object Exploration Time (s)"),ylmP =c(0,100),hLin = F,lvIp = 4,wMain = F)
  
  levBp<-seq(0.7, 5, by=0.2)
  Grp2<- Grp + 
    geom_signif(annotation=c("","","*"),
              y_position=c(95,95,100),
              xmin=c(levBp[1],levBp[1+5], mean(levBp[c(1,4)])),
              xmax=c(levBp[4],levBp[4+5], mean(levBp[c(1+5,4+5)])), 
              tip_length = c(0.02, 0.02),vjust=0.5,textsize=10)+
    geom_signif(annotation=c("","","*"),
              y_position=c(95,95,100),
              xmin=c(levBp[1+10],levBp[1+15], mean(levBp[c(1+10,1+15)])),
              xmax=c(levBp[4+10],levBp[4+15], mean(levBp[c(1+15,4+15)])), 
              tip_length = c(0.02, 0.02),vjust=0.5,textsize=10)
   
  #AOV
  names(rrt$DT)[4:7]<-c("T1","T2","T3","T4")
  ResGen<-AOVMx2(A=2,B=2,C=4,DatPas = rrt,DatEfSp = DatEfS,nBMM1 = 10000,nBMM2 = 1000,Prc = 2)
  AlmacenGen2(GrpP = Grp,Grp2P = Grp2,DataPas = ResGen,PathDesignP = PathDesign,NmBasP = NmBas,Typ=2)
  
  # Other Graphs
    GrpO<-Grph.3.Otros(ExtendDT,LblsP =c("Object Exploration", "D","Total Object Exploration Time (s)"))
    
    ExtendDTCol<-copy(ExtendDT)
    ExtendDTCol$Moment<-"All"
    ExtendDTCol<-data.table(rbind(ExtendDT,ExtendDTCol))
    Grp3<-Grph.3(DatP = ExtendDTCol,"OPR",LblsP =c("Object Exploration", "D","Total Object Exploration Time (s)"),ylmP =c(0,100),hLin = F,lvIp = 5,wMain = T)
    
    pdf(paste0(NmFAlL,NmBas,"OtrosGraphs.pdf"))
      Grp3
      GrpO
    dev.off()
    
        # Results
        plot(Grp)
        plot(Grp2) # Only this graph is printed in the html file.
        GrpO
        plot(Grp3)
        ResGen # Lean option to view the results of statistical analysis
        
        Kbl3(ResPas = ResGen[[1]], lbl = "Omnibus AOV. Design 2x2x(4xS)");cat("\n")
        Kbl3(ResGen[[2]], "Interaction Age-Sleep. Design 2x2x(4xS)")
        Kbl3(ResGen[[3]], "Interaction Age-Time. Design 2x2x(4xS)")
        Kbl3(ResGen[[4]], "Interaction Sleep-Time. Design 2x2x(4xS)")
        Kbl3(ResGen[[5]], "Main Effect Time. Design 2x2x(4xS)")
        Kbl3(ResGen[[6]], "Simple Effect Time each Age-Sleep condition. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[1]][[1]], "Simple Effect Age-Sleep on Time=1 Omnibus AOV. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[1]][[2]], "Simple Effect Age-Sleep on Time=1 Simple Effects. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[1]][[3]], "Simple Effect Age-Sleep on Time=1 Extense Simple Effects. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[2]][[1]], "Simple Effect Age-Sleep on Time=2 Omnibus AOV. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[2]][[2]], "Simple Effect Age-Sleep on Time=2 Simple Effects. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[2]][[3]], "Simple Effect Age-Sleep on Time=2 Extense Simple Effects. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[3]][[1]], "Simple Effect Age-Sleep on Time=3 Omnibus AOV. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[3]][[2]], "Simple Effect Age-Sleep on Time=3 Simple Effects. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[3]][[3]], "Simple Effect Age-Sleep on Time=3 Extense Simple Effects. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[4]][[1]], "Simple Effect Age-Sleep on Time=4 Omnibus AOV. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[4]][[2]], "Simple Effect Age-Sleep on Time=4 Simple Effects. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[4]][[3]], "Simple Effect Age-Sleep on Time=4 Extense Simple Effects. Design 2x2x(4xS)")
           Eff   p.V1 p.Sig
1:   p.value.A 0.7730      
2:   p.value.B 0.7813      
3:   p.value.C 0.0000 *    
4:  p.value.AB 0.5826      
5:  p.value.AC 0.5109      
6:  p.value.BC 0.9750      
7: p.value.ABC 0.7613      
           Eff   p.V1 p.Sig
1:   p.value.A 0.7266      
2:   p.value.B 0.7882      
3:   p.value.C 0.0000 *    
4:  p.value.AB 0.3723      
5:  p.value.AC 0.5700      
6:  p.value.BC 0.9710      
7: p.value.ABC 0.8120      
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
$BP

$Bars

$MargAB

$MargAC

$MargBC

$MargC

quartz_off_screen 
                2 
$BP

$Bars

$MargAB

$MargAC

$MargBC

$MargC

$AOV
            Names    Q      p  pBoot   Sig pBootMas  Sig2
1:            Age 0.12 0.7256 0.7730         0.7266      
2:          Sleep 0.07 0.7904 0.7813         0.7882      
3:           Time 4.08 0.0068 0.0000 *       0.0000 *    
4:      Age*Sleep 0.31 0.5771 0.5826         0.3723      
5:       Age*Time 0.20 0.8986 0.5109         0.5700      
6:     Sleep*Time 0.02 0.9952 0.9750         0.9710      
7: Age*Sleep*Time 0.09 0.9641 0.7613         0.8120      

$InterAB
            Contr psihat    df  test p.value EfSize.V1
1: Sleep on Young  -6.17 50.73 -0.35  0.7290      0.03
2:   Sleep on Old  17.41 52.36  0.88  0.3819      0.12
3: Age on Control  -4.37 50.20 -0.25  0.8066      0.05
4:      Age on SR  19.21 52.65  0.98  0.3340      0.13

$InterAC
             Contr psihat    df  test p.value EfSize.V1
 1:      Age on M1  17.34 29.38  1.12  0.2701      0.20
 2:      Age on M2  -5.97 25.70 -0.41  0.6833      0.08
 3:      Age on M3   0.30 26.44  0.03  0.9772      0.04
 4:      Age on M4   3.18 28.58  0.26  0.7959      0.08
 5: M1-M2 on Young  45.01    NA  3.14  0.0138      0.59
 6:   M1-M2 on Old  18.74    NA  2.37  0.0451      0.28
 7: M2-M3 on Young   9.03    NA  0.88  0.4056      0.13
 8:   M2-M3 on Old  12.36    NA  1.73  0.1215      0.21
 9: M3-M4 on Young -15.67    NA -2.24  0.0551      0.25
10:   M3-M4 on Old  -9.47    NA -1.06  0.3219      0.18

$InterBC
               Contr psihat    df  test p.value EfSize.V1
 1:      Sleep on M1   0.35 29.38  0.02  0.9822      0.01
 2:      Sleep on M2   7.08 25.70  0.49  0.6291      0.07
 3:      Sleep on M3   1.41 26.44  0.14  0.8933      0.04
 4:      Sleep on M4   2.41 28.58  0.20  0.8444      0.07
 5: M1-M2 on Control  32.93    NA  2.12  0.0671      0.46
 6:      M1-M2 on SR  26.55    NA  2.24  0.0553      0.46
 7: M2-M3 on Control  10.67    NA  1.89  0.0956      0.19
 8:      M2-M3 on SR  14.02    NA  1.96  0.0859      0.13
 9: M3-M4 on Control  -9.89    NA -1.65  0.1371      0.26
10:      M3-M4 on SR -10.96    NA -1.32  0.2226      0.19

$DetallMainC
   Contr psihat  test p.value Psihat2 p.value2 EfSize.V1
1: M1-M2  65.47  3.82  0.0051   67.19    0.000      0.46
2: M2-M3  28.35  2.17  0.0618   20.75    0.040      0.15
3: M3-M4 -25.41 -1.75  0.1180  -23.71    0.032      0.23

$DetallTrialCadaCondAB
            Contr psihat df  test p.value Psihat2 p.value2 dif.yuen df.yuen
 1:  M1-M2 on Y_C  18.61 NA  1.79  0.1106   21.02    0.000    21.02      10
 2: M1-M2 on Y_SR  17.51 NA  2.03  0.0768   24.23    0.000    24.23       8
 3:  M1-M2 on O_C   8.49 NA  1.19  0.2682    9.21    0.272     9.21       8
 4: M1-M2 on O_SR   9.79 NA  1.98  0.0834   12.73    0.020    12.73       8
 5:  M2-M3 on Y_C   6.66 NA  1.14  0.2878    3.85    0.344     3.85      10
 6: M2-M3 on Y_SR   4.33 NA  0.90  0.3965    3.39    0.532     3.39       8
 7:  M2-M3 on O_C   4.20 NA  1.51  0.1697    9.36    0.068     9.36       8
 8: M2-M3 on O_SR   7.51 NA  1.30  0.2311    4.15    0.332     4.15       8
 9:  M3-M4 on Y_C -13.59 NA -1.76  0.1167   -8.77    0.128    -8.77      10
10: M3-M4 on Y_SR  -0.82 NA -0.14  0.8955   -4.52    0.444    -4.52       8
11:  M3-M4 on O_C   1.33 NA  0.28  0.7837   -3.59    0.756    -3.59       8
12: M3-M4 on O_SR  -8.77 NA -1.50  0.1708   -6.83    0.104    -6.83       8
    test.yuen EffSize.yuen pvaluet.yuen
 1:      2.82         0.59       0.0182
 2:      2.85         0.57       0.0213
 3:      1.05         0.22       0.3233
 4:      1.95         0.32       0.0876
 5:      0.86         0.13       0.4086
 6:      0.67         0.10       0.5247
 7:      1.52         0.26       0.1662
 8:      0.65         0.14       0.5344
 9:     -1.46         0.34       0.1744
10:     -0.84         0.13       0.4250
11:     -0.75         0.12       0.4770
12:     -1.45         0.30       0.1850

$DetallSimple
$DetallSimple[[1]]
$DetallSimple[[1]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 1.26 0.270   1.26  0.270  0.96 0.3307 0.2821        0.252       
2:     Sleep 0.00 0.983   0.00  0.983  0.02 0.8820 0.9800        0.979       
3: Age*Sleep 0.41 0.526   0.07  0.650  0.18 0.6738 0.5910        0.524       
   EffSize
1:    0.20
2:    0.01
3:    0.12

$DetallSimple[[1]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -4.78 14.18 -0.43  0.6745      0.14      0.18 0.6578
2:   Sleep on Old   5.13 15.41  0.48  0.6374      0.14      0.23 0.6322
3: Age on Control   3.72 15.42  0.36  0.7218      0.08      0.13 0.7100
4:      Age on SR  13.62 14.58  1.18  0.2563      0.31      1.40 0.2833
   EffSize.Boot
1:         0.12
2:         0.11
3:         0.10
4:         0.31

$DetallSimple[[1]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -4.78 14.18 -0.43  0.6745      0.13      0.18 0.6711
2:   Sleep on Old   5.13 15.41  0.48  0.6374      0.11      0.23 0.6289
3: Age on Control   3.72 15.42  0.36  0.7218      0.09      0.13 0.7189
4:      Age on SR  13.62 14.58  1.18  0.2563      0.31      1.40 0.2467
5:      YSR vs OC   8.49 15.76  0.68  0.5052      0.17      0.47 0.5122
   EffSize.Boot
1:         0.13
2:         0.14
3:         0.09
4:         0.31
5:         0.18


$DetallSimple[[2]]
$DetallSimple[[2]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 0.17 0.684   0.17  0.684  0.20 0.6528 0.6912        0.658       
2:     Sleep 0.24 0.630   0.24  0.630  0.10 0.7571 0.6194        0.607       
3: Age*Sleep 0.50 0.487   0.07  0.640  0.34 0.5641 0.5576        0.472       
   EffSize
1:    0.07
2:    0.07
3:    0.19

$DetallSimple[[2]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -1.57 17.67 -0.22  0.8297      0.06      0.05 0.8211
2:   Sleep on Old   8.65 15.98  0.69  0.5009      0.19      0.47 0.5244
3: Age on Control  -8.10 12.73 -0.78  0.4486      0.19      0.61 0.4311
4:      Age on SR   2.12 12.99  0.21  0.8370      0.06      0.04 0.8289
   EffSize.Boot
1:         0.06
2:         0.18
3:         0.20
4:         0.06

$DetallSimple[[2]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -1.57 17.67 -0.22  0.8297      0.06      0.05 0.8422
2:   Sleep on Old   8.65 15.98  0.69  0.5009      0.21      0.47 0.5156
3: Age on Control  -8.10 12.73 -0.78  0.4486      0.20      0.61 0.4378
4:      Age on SR   2.12 12.99  0.21  0.8370      0.06      0.04 0.8344
5:      YSR vs OC  -6.53 12.69 -0.63  0.5421      0.17      0.39 0.5322
   EffSize.Boot
1:         0.06
2:         0.21
3:         0.20
4:         0.06
5:         0.16


$DetallSimple[[3]]
$DetallSimple[[3]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 0.00 0.978   0.00  0.978  0.00 0.9749 0.9766        0.978       
2:     Sleep 0.02 0.894   0.02  0.894  0.01 0.9146 0.9048        0.889       
3: Age*Sleep 0.28 0.603   0.09  0.560  0.38 0.5418 0.8164        0.598       
   EffSize
1:    0.05
2:    0.04
3:    0.16

$DetallSimple[[3]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -2.03 14.48 -0.24  0.8129      0.08      0.06 0.7689
2:   Sleep on Old   3.44 14.82  0.57  0.5795      0.15      0.32 0.5744
3: Age on Control  -2.59 17.62 -0.38  0.7067      0.12      0.15 0.7233
4:      Age on SR   2.89 12.02  0.37  0.7209      0.10      0.13 0.7322
   EffSize.Boot
1:         0.06
2:         0.16
3:         0.12
4:         0.10

$DetallSimple[[3]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -2.03 14.48 -0.24  0.8129      0.08      0.06 0.8056
2:   Sleep on Old   3.44 14.82  0.57  0.5795      0.13      0.32 0.5933
3: Age on Control  -2.59 17.62 -0.38  0.7067      0.11      0.15 0.7189
4:      Age on SR   2.89 12.02  0.37  0.7209      0.10      0.13 0.6844
5:      YSR vs OC  -0.55 14.26 -0.06  0.9491      0.07      0.00 0.9478
   EffSize.Boot
1:         0.08
2:         0.13
3:         0.10
4:         0.10
5:         0.07


$DetallSimple[[4]]
$DetallSimple[[4]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 0.07 0.796   0.07  0.796  0.13 0.7195 0.7880        0.797       
2:     Sleep 0.04 0.845   0.04  0.845  0.01 0.9207 0.8331        0.837       
3: Age*Sleep 0.03 0.870  -0.09  0.570  0.36 0.5536 0.9549        0.870       
   EffSize
1:    0.09
2:    0.07
3:    0.13

$DetallSimple[[4]]$Detall
            Contr psihat    df test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   2.21 12.61 0.27  0.7904      0.08      0.07 0.7644
2:   Sleep on Old   0.20 15.98 0.02  0.9828      0.05      0.00 0.9778
3: Age on Control   2.60 13.45 0.34  0.7372      0.11      0.12 0.7333
4:      Age on SR   0.58 15.75 0.06  0.9521      0.02      0.00 0.9578
   EffSize.Boot
1:         0.08
2:         0.07
3:         0.10
4:         0.02

$DetallSimple[[4]]$DetallExt
            Contr psihat    df test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   2.21 12.61 0.27  0.7904      0.07      0.07 0.8089
2:   Sleep on Old   0.20 15.98 0.02  0.9828      0.05      0.00 0.9900
3: Age on Control   2.60 13.45 0.34  0.7372      0.12      0.12 0.7200
4:      Age on SR   0.58 15.75 0.06  0.9521      0.02      0.00 0.9589
5:      YSR vs OC   0.38 15.85 0.04  0.9688      0.05      0.00 0.9667
   EffSize.Boot
1:         0.07
2:         0.05
3:         0.10
4:         0.02
5:         0.06
Omnibus AOV. Design 2x2x(4xS)
Names Q p pBoot Sig pBootMas Sig2
Age 0.12 0.7256 0.7730 0.7266
Sleep 0.07 0.7904 0.7813 0.7882
Time 4.08 0.0068 0.0000
0.0000
Age*Sleep 0.31 0.5771 0.5826 0.3723
Age*Time 0.20 0.8986 0.5109 0.5700
Sleep*Time 0.02 0.9952 0.9750 0.9710
AgeSleepTime 0.09 0.9641 0.7613 0.8120
Interaction Age-Sleep. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1
Sleep on Young -6.17 50.73 -0.35 0.7290 0.03
Sleep on Old 17.41 52.36 0.88 0.3819 0.12
Age on Control -4.37 50.20 -0.25 0.8066 0.05
Age on SR 19.21 52.65 0.98 0.3340 0.13
Interaction Age-Time. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1
Age on M1 17.34 29.38 1.12 0.2701 0.20
Age on M2 -5.97 25.70 -0.41 0.6833 0.08
Age on M3 0.30 26.44 0.03 0.9772 0.04
Age on M4 3.18 28.58 0.26 0.7959 0.08
M1-M2 on Young 45.01 NA 3.14 0.0138 0.59
M1-M2 on Old 18.74 NA 2.37 0.0451 0.28
M2-M3 on Young 9.03 NA 0.88 0.4056 0.13
M2-M3 on Old 12.36 NA 1.73 0.1215 0.21
M3-M4 on Young -15.67 NA -2.24 0.0551 0.25
M3-M4 on Old -9.47 NA -1.06 0.3219 0.18
Interaction Sleep-Time. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1
Sleep on M1 0.35 29.38 0.02 0.9822 0.01
Sleep on M2 7.08 25.70 0.49 0.6291 0.07
Sleep on M3 1.41 26.44 0.14 0.8933 0.04
Sleep on M4 2.41 28.58 0.20 0.8444 0.07
M1-M2 on Control 32.93 NA 2.12 0.0671 0.46
M1-M2 on SR 26.55 NA 2.24 0.0553 0.46
M2-M3 on Control 10.67 NA 1.89 0.0956 0.19
M2-M3 on SR 14.02 NA 1.96 0.0859 0.13
M3-M4 on Control -9.89 NA -1.65 0.1371 0.26
M3-M4 on SR -10.96 NA -1.32 0.2226 0.19
Main Effect Time. Design 2x2x(4xS)
Contr psihat test p.value Psihat2 p.value2 EfSize.V1
M1-M2 65.47 3.82 0.0051 67.19 0.000 0.46
M2-M3 28.35 2.17 0.0618 20.75 0.040 0.15
M3-M4 -25.41 -1.75 0.1180 -23.71 0.032 0.23
Simple Effect Time each Age-Sleep condition. Design 2x2x(4xS)
Contr psihat df test p.value Psihat2 p.value2 dif.yuen df.yuen test.yuen EffSize.yuen pvaluet.yuen
M1-M2 on Y_C 18.61 NA 1.79 0.1106 21.02 0.000 21.02 10 2.82 0.59 0.0182
M1-M2 on Y_SR 17.51 NA 2.03 0.0768 24.23 0.000 24.23 8 2.85 0.57 0.0213
M1-M2 on O_C 8.49 NA 1.19 0.2682 9.21 0.272 9.21 8 1.05 0.22 0.3233
M1-M2 on O_SR 9.79 NA 1.98 0.0834 12.73 0.020 12.73 8 1.95 0.32 0.0876
M2-M3 on Y_C 6.66 NA 1.14 0.2878 3.85 0.344 3.85 10 0.86 0.13 0.4086
M2-M3 on Y_SR 4.33 NA 0.90 0.3965 3.39 0.532 3.39 8 0.67 0.10 0.5247
M2-M3 on O_C 4.20 NA 1.51 0.1697 9.36 0.068 9.36 8 1.52 0.26 0.1662
M2-M3 on O_SR 7.51 NA 1.30 0.2311 4.15 0.332 4.15 8 0.65 0.14 0.5344
M3-M4 on Y_C -13.59 NA -1.76 0.1167 -8.77 0.128 -8.77 10 -1.46 0.34 0.1744
M3-M4 on Y_SR -0.82 NA -0.14 0.8955 -4.52 0.444 -4.52 8 -0.84 0.13 0.4250
M3-M4 on O_C 1.33 NA 0.28 0.7837 -3.59 0.756 -3.59 8 -0.75 0.12 0.4770
M3-M4 on O_SR -8.77 NA -1.50 0.1708 -6.83 0.104 -6.83 8 -1.45 0.30 0.1850
Simple Effect Age-Sleep on Time=1 Omnibus AOV. Design 2x2x(4xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 1.26 0.270 1.26 0.270 0.96 0.3307 0.2821 0.252 0.20
Sleep 0.00 0.983 0.00 0.983 0.02 0.8820 0.9800 0.979 0.01
Age*Sleep 0.41 0.526 0.07 0.650 0.18 0.6738 0.5910 0.524 0.12
Simple Effect Age-Sleep on Time=1 Simple Effects. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -4.78 14.18 -0.43 0.6745 0.14 0.18 0.6578 0.12
Sleep on Old 5.13 15.41 0.48 0.6374 0.14 0.23 0.6322 0.11
Age on Control 3.72 15.42 0.36 0.7218 0.08 0.13 0.7100 0.10
Age on SR 13.62 14.58 1.18 0.2563 0.31 1.40 0.2833 0.31
Simple Effect Age-Sleep on Time=1 Extense Simple Effects. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -4.78 14.18 -0.43 0.6745 0.13 0.18 0.6711 0.13
Sleep on Old 5.13 15.41 0.48 0.6374 0.11 0.23 0.6289 0.14
Age on Control 3.72 15.42 0.36 0.7218 0.09 0.13 0.7189 0.09
Age on SR 13.62 14.58 1.18 0.2563 0.31 1.40 0.2467 0.31
YSR vs OC 8.49 15.76 0.68 0.5052 0.17 0.47 0.5122 0.18
Simple Effect Age-Sleep on Time=2 Omnibus AOV. Design 2x2x(4xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.17 0.684 0.17 0.684 0.20 0.6528 0.6912 0.658 0.07
Sleep 0.24 0.630 0.24 0.630 0.10 0.7571 0.6194 0.607 0.07
Age*Sleep 0.50 0.487 0.07 0.640 0.34 0.5641 0.5576 0.472 0.19
Simple Effect Age-Sleep on Time=2 Simple Effects. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -1.57 17.67 -0.22 0.8297 0.06 0.05 0.8211 0.06
Sleep on Old 8.65 15.98 0.69 0.5009 0.19 0.47 0.5244 0.18
Age on Control -8.10 12.73 -0.78 0.4486 0.19 0.61 0.4311 0.20
Age on SR 2.12 12.99 0.21 0.8370 0.06 0.04 0.8289 0.06
Simple Effect Age-Sleep on Time=2 Extense Simple Effects. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -1.57 17.67 -0.22 0.8297 0.06 0.05 0.8422 0.06
Sleep on Old 8.65 15.98 0.69 0.5009 0.21 0.47 0.5156 0.21
Age on Control -8.10 12.73 -0.78 0.4486 0.20 0.61 0.4378 0.20
Age on SR 2.12 12.99 0.21 0.8370 0.06 0.04 0.8344 0.06
YSR vs OC -6.53 12.69 -0.63 0.5421 0.17 0.39 0.5322 0.16
Simple Effect Age-Sleep on Time=3 Omnibus AOV. Design 2x2x(4xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.00 0.978 0.00 0.978 0.00 0.9749 0.9766 0.978 0.05
Sleep 0.02 0.894 0.02 0.894 0.01 0.9146 0.9048 0.889 0.04
Age*Sleep 0.28 0.603 0.09 0.560 0.38 0.5418 0.8164 0.598 0.16
Simple Effect Age-Sleep on Time=3 Simple Effects. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -2.03 14.48 -0.24 0.8129 0.08 0.06 0.7689 0.06
Sleep on Old 3.44 14.82 0.57 0.5795 0.15 0.32 0.5744 0.16
Age on Control -2.59 17.62 -0.38 0.7067 0.12 0.15 0.7233 0.12
Age on SR 2.89 12.02 0.37 0.7209 0.10 0.13 0.7322 0.10
Simple Effect Age-Sleep on Time=3 Extense Simple Effects. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -2.03 14.48 -0.24 0.8129 0.08 0.06 0.8056 0.08
Sleep on Old 3.44 14.82 0.57 0.5795 0.13 0.32 0.5933 0.13
Age on Control -2.59 17.62 -0.38 0.7067 0.11 0.15 0.7189 0.10
Age on SR 2.89 12.02 0.37 0.7209 0.10 0.13 0.6844 0.10
YSR vs OC -0.55 14.26 -0.06 0.9491 0.07 0.00 0.9478 0.07
Simple Effect Age-Sleep on Time=4 Omnibus AOV. Design 2x2x(4xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.07 0.796 0.07 0.796 0.13 0.7195 0.7880 0.797 0.09
Sleep 0.04 0.845 0.04 0.845 0.01 0.9207 0.8331 0.837 0.07
Age*Sleep 0.03 0.870 -0.09 0.570 0.36 0.5536 0.9549 0.870 0.13
Simple Effect Age-Sleep on Time=4 Simple Effects. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 2.21 12.61 0.27 0.7904 0.08 0.07 0.7644 0.08
Sleep on Old 0.20 15.98 0.02 0.9828 0.05 0.00 0.9778 0.07
Age on Control 2.60 13.45 0.34 0.7372 0.11 0.12 0.7333 0.10
Age on SR 0.58 15.75 0.06 0.9521 0.02 0.00 0.9578 0.02
Simple Effect Age-Sleep on Time=4 Extense Simple Effects. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 2.21 12.61 0.27 0.7904 0.07 0.07 0.8089 0.07
Sleep on Old 0.20 15.98 0.02 0.9828 0.05 0.00 0.9900 0.05
Age on Control 2.60 13.45 0.34 0.7372 0.12 0.12 0.7200 0.10
Age on SR 0.58 15.75 0.06 0.9521 0.02 0.00 0.9589 0.02
YSR vs OC 0.38 15.85 0.04 0.9688 0.05 0.00 0.9667 0.06

2.4 Fig 1E Percent change in preference for displaced object excluding trial 1 {Design 2x2}

  NmBas="Fig1E OPRWithoutT1"
  ResGen<-NA
  
  rrt<-ExData.2(nmF = paste0(PathDesign,"OPR.csv"),Vars = c(1:2,4))
  DatDT<-rrt$DT
  ArP<-rrt$Arp
  
  #Graphs
  Grp<- Grph.2(DatDT,"OPRSinT1",LblsP =c("Preference for Displaced Object", "","% Change in Object Preference"),c(-40,50),T)
  
  Grp2<- Grp + geom_signif(annotation="*",
              y_position=50, xmin=1  , xmax=2, 
              tip_length = c(0.02, 0.02),vjust=0.5,textsize=10) +
    geom_signif(annotation="*",
              y_position=40, xmin=3  , xmax=4, 
              tip_length = c(0.02, 0.02),vjust=0.5,textsize=10)+
    geom_signif(annotation="*",
              y_position=35, xmin=1  , xmax=3, 
              tip_length = c(0.02, 0.02),vjust=0.5,textsize=10)+
    geom_signif(annotation="*",
              y_position=45, xmin=2  , xmax=4, 
              tip_length = c(0.02, 0.02),vjust=0.5,textsize=10)
  
    # AOV & Simple Effects
    names(rrt$DT)[3]<-"DepV"
    ResGen<-AOVBwF(2,2,DatPas = rrt,nBMM = 10000)
    AlmacenGen(Grp,Grp2,ResGen,PathDesign,NmBas,Typ=1)
    
        # Results
        plot(Grp)
        plot(Grp2) # Only this graph is printed in the html file.
        ResGen  # Lean option to view the results of statistical analysis
        
        Kbl3(ResGen[[1]], "Omnibus AOV. Design 2x2");cat("\n")
        Kbl3(ResGen[[2]], "Simple Effects Age-Sleep. Design 2x2")
        Kbl3(ResGen[[3]], "Extense Simple Effects Age-Sleep. Design 2x2")
[1] "Taking bootstrap samples. Please wait."
          Eff   p.V1 p.Sig
1:  A.p.value 0.5559      
2:  B.p.value 0.2554      
3: AB.p.value 0.0000 *    
[1] "Taking bootstrap samples. Please wait."
          Eff   p.V1 p.Sig
1:  A.p.value 0.5376      
2:  B.p.value 0.2728      
3: AB.p.value 0.0002 *    
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
$AOV
       Names     Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot   Sig pBootMas
1:       Age  0.39 0.538   0.39  0.538  0.39 0.5348 0.5559         0.5376
2:     Sleep  1.23 0.277   1.23  0.277  1.14 0.2903 0.2554         0.2728
3: Age*Sleep 17.36 0.001  -0.55  0.000 17.87 0.0001 0.0000 *       0.0002
   SigMas EffSize
1:           0.12
2:           0.16
3:  *        0.85

$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  13.33 17.06  2.15  0.0458      0.51      4.64 0.0489
2:   Sleep on Old -22.99 13.66 -3.74  0.0023      0.74     14.01 0.0044
3: Age on Control  15.44 16.13  2.34  0.0323      0.54      5.49 0.0422
4:      Age on SR -20.88 14.50 -3.66  0.0024      0.74     13.40 0.0056
   EffSize.Boot
1:         0.51
2:         0.74
3:         0.55
4:         0.74

$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  13.33 17.06  2.15  0.0458      0.52      4.64 0.0522
2:   Sleep on Old -22.99 13.66 -3.74  0.0023      0.74     14.01 0.0044
3: Age on Control  15.44 16.13  2.34  0.0323      0.51      5.49 0.0322
4:      Age on SR -20.88 14.50 -3.66  0.0024      0.74     13.40 0.0111
5:      YSR vs OC   2.11 15.82  0.30  0.7652      0.09      0.09 0.7533
   EffSize.Boot
1:         0.51
2:         0.74
3:         0.52
4:         0.74
5:         0.10
Omnibus AOV. Design 2x2
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.39 0.538 0.39 0.538 0.39 0.5348 0.5559 0.5376 0.12
Sleep 1.23 0.277 1.23 0.277 1.14 0.2903 0.2554 0.2728 0.16
Age*Sleep 17.36 0.001 -0.55 0.000 17.87 0.0001 0.0000
0.0002
0.85
Simple Effects Age-Sleep. Design 2x2
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 13.33 17.06 2.15 0.0458 0.51 4.64 0.0489 0.51
Sleep on Old -22.99 13.66 -3.74 0.0023 0.74 14.01 0.0044 0.74
Age on Control 15.44 16.13 2.34 0.0323 0.54 5.49 0.0422 0.55
Age on SR -20.88 14.50 -3.66 0.0024 0.74 13.40 0.0056 0.74
Extense Simple Effects Age-Sleep. Design 2x2
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 13.33 17.06 2.15 0.0458 0.52 4.64 0.0522 0.51
Sleep on Old -22.99 13.66 -3.74 0.0023 0.74 14.01 0.0044 0.74
Age on Control 15.44 16.13 2.34 0.0323 0.51 5.49 0.0322 0.52
Age on SR -20.88 14.50 -3.66 0.0024 0.74 13.40 0.0111 0.74
YSR vs OC 2.11 15.82 0.30 0.7652 0.09 0.09 0.7533 0.10

2.5 Fig 1F Percent change in preference for displaced object in young and old mice receiving delayed SD 5 hr after training {Design 2}

  NmBas="Fig1F OPRDelayed"
  
  DatDTFull <- data.table(read.table(paste0(PathDesign,"OPRDelayed.csv"), header=TRUE, sep=";",
                                     na.strings="NA", dec=",",strip.white=TRUE))
  DatDT<-DatDTFull
  DatDT$Group<-factor(DatDT$Group);DatDT$Group<-relevel(DatDT$Group,"Young_DSR")
  
  #Graphs
  Grp<- Grph.1(DatDT,"OPRDelayed",LblsP =c("Preference for Displaced Object", "","% Change in Object Preference"),c(-10,15),T,GrpSel=c(2,4))
  
  Grp2<- Grp + geom_signif(annotation="*",
              y_position=15, xmin=1  , xmax=2, 
              tip_length = c(0.02, 0.02),vjust=0.5,textsize=10)
    
  YuenRes<-WRS2::yuen(OPRDelayed~Group,DatDT)
  ResFn<-list()
  ResFn$AOV<-data.table(with(YuenRes, cbind(diff=round(diff,2),df=round(df,2),test=round(test,2),EffSize=round(effsize,2),p=round(p.value,4))))
  AlmacenGen(GrpP = Grp,Grp2P = Grp2,DataPas = ResFn,PathDesignP = PathDesign,NmBasP = NmBas,Typ = 1)
  
  #Results
    plot(Grp)
    plot(Grp2)
    ResFn
$AOV
    diff   df test EffSize      p
1: 11.96 6.88 4.85    0.88 0.0019

2.6 Fig 1G Levels of plasma corticosterone in control and SD mice {Design 2x2}

  NmBas="Fig1G Cortisol"
  ResGen<-NA
  
  rrt<-ExData.2(nmF = paste0(PathDesign,"Cortisol.csv"),Vars = c(1:4))
  DatDT<-rrt$DT
  ArP<-rrt$Arp
  
  #Graphs
  Grp<- Grph.2(DatDT,"cortisol",LblsP =c("Preference for Displaced Object", "","Corticosterone (ng/ml)"),c(0,200),F)
  
  Grp2<-Grp + 
    geom_signif(annotation=c("","","*"),
              y_position=c(190,195,200),
              xmin=c(1,2, 1.9),
              xmax=c(3,4, 3), 
              tip_length = c(c(0.02, 0.02),c(0.02, 0.02),c(0.08, 0.02)),vjust=0.5,textsize=10)

  # AOV & Simple Effects
  names(rrt$DT)[4]<-"DepV"
  ResGen<-AOVBwF(2,2,DatPas = rrt,nBMM = 10000)
  AlmacenGen(Grp,Grp2,ResGen,PathDesign,NmBas,Typ=1)
  
      # Results
      plot(Grp)
      plot(Grp2) # Only this graph is printed in the html file.
      ResGen  # Lean option to view the results of statistical analysis
      
      Kbl3(ResGen[[1]], "Omnibus AOV. Design 2x2");cat("\n")
      Kbl3(ResGen[[2]], "Simple Effects Age-Sleep. Design 2x2")
      Kbl3(ResGen[[3]], "Extense Simple Effects Age-Sleep. Design 2x2")
[1] "Taking bootstrap samples. Please wait."
          Eff p.V1 p.Sig
1:  A.p.value   NA      
2:  B.p.value   NA      
3: AB.p.value   NA      
[1] "Taking bootstrap samples. Please wait."
          Eff   p.V1 p.Sig
1:  A.p.value 0.6838      
2:  B.p.value 0.2859      
3: AB.p.value 0.7627      
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
$AOV
       Names     Q     p Q.RMul p.RMul F.Rk1  p.Rk1 pBoot Sig pBootMas SigMas
1:       Age  0.29 0.610   0.29  0.610  0.04 0.8470    NA       0.6838       
2:     Sleep 16.85 0.002  16.85  0.002  7.05 0.0201    NA       0.2859       
3: Age*Sleep  0.13 0.726   0.04  0.860  0.00 0.9734    NA       0.7627       
   EffSize
1:    0.06
2:    0.82
3:    0.08

$Detall
            Contr psihat   df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young -41.34 4.00 -2.28  0.0851      0.79      5.18 0.0317
2:   Sleep on Old -49.42 3.53 -3.92  0.0218      0.88     15.36 0.0465
3: Age on Control  -1.86 4.67 -0.11  0.9201      0.18      0.01 0.9330
4:      Age on SR  -9.94 2.32 -0.74  0.5253      0.32      0.55 0.5242
   EffSize.Boot
1:         0.79
2:         0.88
3:         0.17
4:         0.32

$DetallExt
            Contr psihat   df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young -41.34 4.00 -2.28  0.0851      0.79      5.18 0.0353
2:   Sleep on Old -49.42 3.53 -3.92  0.0218      0.88     15.36 0.0455
3: Age on Control  -1.86 4.67 -0.11  0.9201      0.18      0.01 0.9362
4:      Age on SR  -9.94 2.32 -0.74  0.5253      0.32      0.55 0.4891
5:      YSR vs OC  39.47 4.66  2.24  0.0793      0.72      5.01 0.0538
   EffSize.Boot
1:         0.79
2:         0.88
3:         0.18
4:         0.32
5:         0.69
Omnibus AOV. Design 2x2
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.29 0.610 0.29 0.610 0.04 0.8470 NA 0.6838 0.06
Sleep 16.85 0.002 16.85 0.002 7.05 0.0201 NA 0.2859 0.82
Age*Sleep 0.13 0.726 0.04 0.860 0.00 0.9734 NA 0.7627 0.08
Simple Effects Age-Sleep. Design 2x2
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -41.34 4.00 -2.28 0.0851 0.79 5.18 0.0317 0.79
Sleep on Old -49.42 3.53 -3.92 0.0218 0.88 15.36 0.0465 0.88
Age on Control -1.86 4.67 -0.11 0.9201 0.18 0.01 0.9330 0.17
Age on SR -9.94 2.32 -0.74 0.5253 0.32 0.55 0.5242 0.32
Extense Simple Effects Age-Sleep. Design 2x2
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -41.34 4.00 -2.28 0.0851 0.79 5.18 0.0353 0.79
Sleep on Old -49.42 3.53 -3.92 0.0218 0.88 15.36 0.0455 0.88
Age on Control -1.86 4.67 -0.11 0.9201 0.18 0.01 0.9362 0.18
Age on SR -9.94 2.32 -0.74 0.5253 0.32 0.55 0.4891 0.32
YSR vs OC 39.47 4.66 2.24 0.0793 0.72 5.01 0.0538 0.69


3 Figure 2. Rate and global remapping across sessions and percentage.


Figure 2. Rate and global remapping across sessions and percentage of different cell types during OPR performance. A) OPR performance comparing tetrode, EEG/EMG and all implanted animals. B) Isolation distance showing absence of differences in spike cluster quality across conditions over time. C) Average rate remapping for all groups across trials. Young controls and old SD mice displayed higher rate remapping during the test trial in comparison to the last training trial (T3). Additionally, these groups also displayed more rate remapping than young SD mice during the test. D) Average global remapping (map similarity) for all groups across trials. Old animals displayed more remapping (i.e., instability) than young mice between the habituation and trial 1 and during testing. E-F) Percentage of context, object configuration, and unstable cells recorded in young (E) and old (F) mice. Young controls: 6 mice, 60 cells, range of cells per animal: 6-16, young SD: 4 mice, 50 cells, range of cells per animal: 8-18, old control: 5 mice, 36 cells, range of cells per animal: 5-13, old SD: 5 mice, 41 cells: range of cells per animal: 4-13. Hab: habituation, T1-T3: training trials. Asterisks (*) represent significance using alpha=0.05. Statistical details in Supplemental Statistical Table corresponding to Figure 2.


3.1 Fig 2A OPR performance comparing tetrode, EEG/EMG and all implanted animals {Design 2x2x2}

    NmBas="Fig2A CompareTetrodeEEG"
    NmFich="OPR.csv";
    NmFAlL<-paste0(PathDesign,NmBas)
    if (!dir.exists(NmFAlL)) {dir.create(NmFAlL)}
    NmFAlL<-paste0(NmFAlL,"/")
    
    NmFich<-paste0(PathDesign,NmFich);
    DatDTFull <- data.table(read.table(NmFich, header=TRUE, sep=";", na.strings="NA", dec=",",strip.white=TRUE))
    DatDTFull$Age<-factor(DatDTFull$Age);DatDTFull$Age<-relevel(DatDTFull$Age,"Young")
    DatDTFull$Sleep<-factor(DatDTFull$Sleep);levels(DatDTFull$Sleep) <- list("Control"="control", "SR"="restriction")
    DatDTFull$Implant<-factor(DatDTFull$Implant);DatDTFull$Implant<-relevel(DatDTFull$Implant,"Tetrode")
    setkey(DatDTFull,Age,Sleep,Implant)
    
    ArP3w<-unlist(unlist(lapply(1:2, function (x) lapply(1:2, function(y) lapply(1:2, function(z) na.omit(DatDTFull[.(levels(DatDTFull$Age)[x],levels(DatDTFull$Sleep)[y],levels(DatDTFull$Implant)[z]),3,with=F][[1]])))),recursive = F),recursive = F)
                        

    ResRo<-list()
    RsRb<-t3way(2,2,2,ArP3w)
    
    ExRsRbp<-with(RsRb, round(c(A.p.value, B.p.value,C.p.value, AB.p.value, AC.p.value, BC.p.value, ABC.p.value),4))
    ExRsRbQ<-with(RsRb, round(c(Qa, Qb,Qc, Qab, Qac, Qbc, Qabc),2))
    ExFn<-data.table(ExRsRbQ,ExRsRbp)
    names(ExFn)<-c("Q","p")
    ExFnFn<-data.table(Names=c("Age","Sleep","Implant","Age*Sleep","Age*Implant","Sleep*Implant","Age*Sleep*Implant"),ExFn)
   
    #write.csv2(ExFnFn,paste0(NmFAlL,NmBas,"Omn.csv"))
    DatDTCop<-copy(DatDTFull)
    names(DatDTCop)[3]<-"DepVar"
    Grp<- Grph.3d(DatP = DatDTCop,"OPR",LblsP =c("Preference for Unmoved Objects", "","% Change in Object Preference"),ylmP =c(-40,50),hLin = T,lvIp = 2,wMain = F)
  
    levBp<-seq(0.7, 4, by=0.2)
    Grp2<- Grp + 
    geom_signif(annotation=c("","","*"),
              y_position=c(33,34,35),
              xmin=c(levBp[1],levBp[2], 0.1+mean(levBp[c(1)])),
              xmax=c(levBp[1+5],levBp[2+5], mean(levBp[c(2,2+5)])), 
              tip_length = c(c(0.01, 0.01),c(0.01, 0.01),c(0.02, 0.01)),vjust=0.5,textsize=10) +
    geom_signif(annotation=c("","","*"),
              y_position=c(37,38,39),
              xmin=c(levBp[3],levBp[4], 0.1+mean(levBp[c(3)])),
              xmax=c(levBp[3+5],levBp[4+5], mean(levBp[c(4,4+5)])), 
              tip_length = c(c(0.01, 0.01),c(0.01, 0.01),c(0.02, 0.01)),vjust=0.5,textsize=10) +
    geom_signif(annotation=c("","","*"),
              y_position=c(41,42,43),
              xmin=c(levBp[1],levBp[3], 0.1+mean(levBp[c(1)])),
              xmax=c(levBp[1+5],levBp[3+5], mean(levBp[c(3,3+5)])), 
              tip_length = c(c(0.01, 0.01),c(0.01, 0.01),c(0.02, 0.01)),vjust=0.5,textsize=10) +
    geom_signif(annotation=c("","","*"),
              y_position=c(45,46,47),
              xmin=c(levBp[2],levBp[4], 0.1+mean(levBp[c(2)])),
              xmax=c(levBp[2+5],levBp[4+5], mean(levBp[c(4,4+5)])), 
              tip_length = c(c(0.01, 0.01),c(0.01, 0.01),c(0.02, 0.01)),vjust=0.5,textsize=10)
    
    ExtendDTCol<-copy(DatDTCop)
    ExtendDTCol$Implant<-"All"
    ExtendDTCol<-data.table(rbind(DatDTCop,ExtendDTCol))
    
    Grp3<- Grph.3c(DatP = ExtendDTCol,"OPR",LblsP =c("Preference for Unmoved Objects", "","% Change in Object Preference"),ylmP =c(-40,50),hLin = T,lvIp = 3,wMain = F)
    
    ResFn<-list()
    ResFn$AOV<-ExFnFn
    AlmacenGen(GrpP = Grp,Grp2P = Grp2,DataPas = ResFn,PathDesignP = PathDesign,NmBasP = NmBas,Typ = 1)
    
    pdf(paste0(NmFAlL,NmBas,"OtrosGraphs.pdf"))
      Grp3
    dev.off()
    
    #Results
    plot(Grp)
    plot(Grp2)
    plot(Grp3)
    ResFn
    
    Kbl3(ResPas = ResFn[[1]], lbl = "Omnibus AOV. Design 2x2x2")
quartz_off_screen 
                2 
$AOV
               Names     Q     p
1:               Age  0.42 0.530
2:             Sleep  0.03 0.860
3:           Implant  0.27 0.609
4:         Age*Sleep 17.53 0.001
5:       Age*Implant  0.13 0.723
6:     Sleep*Implant  2.06 0.168
7: Age*Sleep*Implant  0.82 0.378
Omnibus AOV. Design 2x2x2
Names Q p
Age 0.42 0.530
Sleep 0.03 0.860
Implant 0.27 0.609
Age*Sleep 17.53 0.001
Age*Implant 0.13 0.723
Sleep*Implant 2.06 0.168
AgeSleepImplant 0.82 0.378

3.2 Fig 2B Cluster Quality Analysis of Isolation Distance {Design 2x2x(5xS)}

  NmBas="Fig2B IsolationDistance"
  NmFAlL<-paste0(PathDesign,NmBas)
  if (!dir.exists(NmFAlL)) {dir.create(NmFAlL)}
  NmFAlL<-paste0(NmFAlL,"/")
  ResGen<-NA
  
  rrt<-ExDataIS.2(nmF = paste0(PathDesign,"ClusterQuality.csv"),Vars = c(1,5,6,7:11),vIntP =c(4:8),lvlCh = list("HAB"="id_s1", "T1"="id_s2","T2"="id_s3","T3"="id_s4","Test"="id_s5"))
  DatDT<-rrt$DT
  ArP<-rrt$Arp
  ExtendDT<-rrt$ExtendDT
  
  # For Simple Effects
  DatEfS<-list()
  for(is in 1:5) {
    DatEfS[[is]]<-ExData.2(nmF = paste0(PathDesign,"ClusterQuality.csv"),Vars = c(5:6,(6+is)))
    names(DatEfS[[is]]$DT)[3]<-"DepV"
  }
  
  #Graphs
  Grp<- Grph.3(DatP = ExtendDT,"OPR",LblsP =c("Cluster Quality", "","Isolation Distance"),ylmP =c(0,40),hLin = F,lvIp=5)
  Grp2=Grp
    
    #AOV
    names(rrt$DT)[4:8]<-c("T1","T2","T3","T4","T5")
    ResGen<-AOVMx2.5(A=2,B=2,C=5,DatPas = rrt,DatEfSp = DatEfS,nBMM1 = 10000,nBMM2 = 1000,Prc = 2)
    AlmacenGen2(GrpP = Grp,Grp2P = Grp2,DataPas = ResGen,PathDesignP = PathDesign,NmBasP = NmBas,Typ=2)
  
  # Other Graphs
    GrpO<-Grph.3.Otros(ExtendDT,LblsP =c("Cluster Quality", "H","Isolation Distance"))
    
    ExtendDTCol<-copy(ExtendDT)
    ExtendDTCol$Moment<-"All"
    ExtendDTCol<-data.table(rbind(ExtendDT,ExtendDTCol))
    Grp3<-Grph.3(DatP = ExtendDTCol,"OPR",LblsP =c("Cluster Quality", "H","Isolation Distance"),
                 ylmP =c(0,40),hLin = F,lvIp = 6,wMain = T)
    
    pdf(paste0(NmFAlL,NmBas,"OtrosGraphs.pdf"))
      Grp3
      GrpO
    dev.off()
    
        # Results
        plot(Grp)
        plot(Grp2) # Only this graph is printed in the html file.
        GrpO
        plot(Grp3)
        ResGen # Lean option to view the results of statistical analysis
        
        Kbl3(ResPas = ResGen[[1]], lbl = "Omnibus AOV. Design 2x2x(5xS)");cat("\n")
        Kbl3(ResGen[[2]], "Interaction Age-Sleep. Design 2x2x(5xS)")
        Kbl3(ResGen[[3]], "Interaction Age-Time. Design 2x2x(5xS)")
        Kbl3(ResGen[[4]], "Interaction Sleep-Time. Design 2x2x(5xS)")
        Kbl3(ResGen[[5]], "Main Effect Time. Design 2x2x(5xS)")
        Kbl3(ResGen[[6]], "Simple Effect Time each Age-Sleep condition. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[1]][[1]], "Simple Effect Age-Sleep on Time=1 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[1]][[2]], "Simple Effect Age-Sleep on Time=1 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[1]][[3]], "Simple Effect Age-Sleep on Time=1 Extense Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[2]][[1]], "Simple Effect Age-Sleep on Time=2 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[2]][[2]], "Simple Effect Age-Sleep on Time=2 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[2]][[3]], "Simple Effect Age-Sleep on Time=2 Extense Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[3]][[1]], "Simple Effect Age-Sleep on Time=3 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[3]][[2]], "Simple Effect Age-Sleep on Time=3 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[3]][[3]], "Simple Effect Age-Sleep on Time=3 Extense Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[4]][[1]], "Simple Effect Age-Sleep on Time=4 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[4]][[2]], "Simple Effect Age-Sleep on Time=4 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[4]][[3]], "Simple Effect Age-Sleep on Time=4 Extense Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[5]][[1]], "Simple Effect Age-Sleep on Time=5 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[5]][[2]], "Simple Effect Age-Sleep on Time=5 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[5]][[3]], "Simple Effect Age-Sleep on Time=5 Extense Simple Effects. Design 2x2x(5xS)")
           Eff   p.V1 p.Sig
1:   p.value.A 0.7129      
2:   p.value.B 0.8948      
3:   p.value.C 0.2287      
4:  p.value.AB 0.7028      
5:  p.value.AC 0.4541      
6:  p.value.BC 0.6611      
7: p.value.ABC 0.8865      
           Eff   p.V1 p.Sig
1:   p.value.A 0.7273      
2:   p.value.B 0.8835      
3:   p.value.C 0.3148      
4:  p.value.AB 0.8478      
5:  p.value.AC 0.5307      
6:  p.value.BC 0.7329      
7: p.value.ABC 0.9020      
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
$BP

$Bars

$MargAB

$MargAC

$MargBC

$MargC

quartz_off_screen 
                2 
$BP

$Bars

$MargAB

$MargAC

$MargBC

$MargC

$AOV
            Names    Q      p  pBoot Sig pBootMas Sig2
1:            Age 0.12 0.7267 0.7129       0.7273     
2:          Sleep 0.02 0.8851 0.8948       0.8835     
3:           Time 0.48 0.7476 0.2287       0.3148     
4:      Age*Sleep 0.14 0.7101 0.7028       0.8478     
5:       Age*Time 0.32 0.8647 0.4541       0.5307     
6:     Sleep*Time 0.20 0.9370 0.6611       0.7329     
7: Age*Sleep*Time 0.11 0.9805 0.8865       0.9020     

$InterAB
            Contr psihat     df  test p.value EfSize.V1
1: Sleep on Young  -0.77 245.45 -0.24  0.8082      0.10
2:   Sleep on Old   1.65 184.45  0.44  0.6634      0.06
3: Age on Control  -0.11 153.44 -0.03  0.9739      0.11
4:      Age on SR   2.31 244.51  0.64  0.5236      0.06

$InterAC
             Contr psihat    df  test p.value EfSize.V1
 1:      Age on M1   0.77 84.00  0.29  0.7700      0.03
 2:      Age on M2  -1.33 70.26 -0.58  0.5613      0.04
 3:      Age on M3   0.32 91.93  0.14  0.8851      0.03
 4:      Age on M4   3.02 96.36  1.61  0.1097      0.17
 5:      Age on M5  -0.57 78.02 -0.29  0.7738      0.05
 6: M1-M2 on Young   3.47    NA  1.48  0.1541      0.05
 7:   M1-M2 on Old   1.23    NA  0.38  0.7104      0.02
 8: M2-M3 on Young  -2.05    NA -1.92  0.0683      0.07
 9:   M2-M3 on Old  -1.62    NA -0.55  0.5871      0.02
10: M3-M4 on Young  -0.47    NA -0.26  0.7992      0.06
11:   M3-M4 on Old   3.73    NA  2.14  0.0445      0.23
12: M4-M5 on Young  -0.44    NA -0.19  0.8482      0.03
13:   M4-M5 on Old  -4.40    NA -1.67  0.1107      0.19

$InterBC
             Contr psihat    df  test p.value EfSize.V1
 1:    Sleep on M1  -0.02 84.00 -0.01  0.9954      0.01
 2:    Sleep on M2   2.72 70.26  1.19  0.2376      0.13
 3:    Sleep on M3   0.56 91.93  0.25  0.8015      0.01
 4:    Sleep on M4  -1.10 96.36 -0.59  0.5593      0.05
 5:    Sleep on M5  -1.28 78.02 -0.65  0.5190      0.09
 6: M1-M2 on Young   1.55    NA  0.61  0.5488      0.04
 7:   M1-M2 on Old   4.16    NA  1.52  0.1443      0.08
 8: M2-M3 on Young  -0.69    NA -0.48  0.6334      0.00
 9:   M2-M3 on Old  -3.68    NA -2.31  0.0311      0.11
10: M3-M4 on Young   2.77    NA  1.40  0.1774      0.19
11:   M3-M4 on Old   1.53    NA  0.81  0.4278      0.09
12: M4-M5 on Young  -0.59    NA -0.29  0.7775      0.07
13:   M4-M5 on Old  -2.94    NA -1.13  0.2712      0.08

$DetallMainC
   Contr psihat  test p.value Psihat2 p.value2 EfSize.V1
1: M1-M2   4.84  1.03  0.3140    0.27    0.848      0.02
2: M2-M3  -2.52 -0.83  0.4162   -1.93    0.444      0.05
3: M3-M4   1.73  0.85  0.4074    5.62    0.052      0.13
4: M4-M5  -2.95 -0.75  0.4589   -3.24    0.476      0.07

$DetallTrialCadaCondAB
            Contr psihat df  test p.value Psihat2 p.value2 dif.yuen df.yuen
 1:  M1-M2 on Y_C   0.32 NA  0.46  0.6497   -0.08    0.968    -0.08      35
 2: M1-M2 on Y_SR   1.47 NA  1.50  0.1492    1.26    0.400     1.26      29
 3:  M1-M2 on O_C  -1.24 NA -0.84  0.4125   -1.16    0.580    -1.16      21
 4: M1-M2 on O_SR   0.72 NA  0.92  0.3658    0.24    0.704     0.24      24
 5:  M2-M3 on Y_C  -0.01 NA -0.01  0.9908    0.19    0.832     0.19      35
 6: M2-M3 on Y_SR  -1.46 NA -2.17  0.0414   -1.98    0.212    -1.98      29
 7:  M2-M3 on O_C   0.26 NA  0.17  0.8669   -0.07    0.912    -0.07      21
 8: M2-M3 on O_SR  -0.97 NA -0.70  0.4911   -0.07    0.820    -0.07      24
 9:  M3-M4 on Y_C  -0.19 NA -0.40  0.6917    0.57    0.564     0.57      35
10: M3-M4 on Y_SR  -0.06 NA -0.04  0.9675    0.89    0.572     0.89      29
11:  M3-M4 on O_C   2.31 NA  1.98  0.0605    3.06    0.052     3.06      21
12: M3-M4 on O_SR   0.28 NA  0.45  0.6564    1.09    0.452     1.09      24
13:  M4-M5 on Y_C  -0.69 NA -0.42  0.6823    0.14    0.868    -0.03      32
14: M4-M5 on Y_SR   0.13 NA  0.14  0.8907    0.04    1.000     0.04      29
15:  M4-M5 on O_C  -1.28 NA -0.93  0.3633   -1.66    0.356    -1.66      21
16: M4-M5 on O_SR  -2.65 NA -1.82  0.0826   -1.75    0.476    -1.75      24
    test.yuen EffSize.yuen pvaluet.yuen
 1:     -0.08         0.01       0.9347
 2:      0.92         0.13       0.3655
 3:     -0.52         0.09       0.6060
 4:      0.20         0.03       0.8447
 5:      0.19         0.02       0.8502
 6:     -1.47         0.16       0.1518
 7:     -0.04         0.01       0.9649
 8:     -0.05         0.01       0.9623
 9:      0.62         0.07       0.5377
10:      0.58         0.08       0.5638
11:      2.49         0.42       0.0211
12:      1.06         0.12       0.2983
13:     -0.02         0.04       0.9823
14:      0.04         0.00       0.9703
15:     -1.09         0.18       0.2890
16:     -1.13         0.19       0.2682

$DetallSimple
$DetallSimple[[1]]
$DetallSimple[[1]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 0.09 0.771   0.09  0.771  0.07 0.7860 0.7646        0.766       
2:     Sleep 0.00 0.996   0.00  0.996  0.00 0.9655 0.9933        0.997       
3: Age*Sleep 0.00 0.986  -0.02  0.780  0.03 0.8606 0.9850        0.985       
   EffSize
1:    0.04
2:    0.01
3:    0.01

$DetallSimple[[1]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.03 52.24 -0.02  0.9842      0.03      0.00 0.9800
2:   Sleep on Old   0.02 43.54  0.01  0.9940      0.03      0.00 0.9878
3: Age on Control   0.36 34.15  0.20  0.8419      0.05      0.04 0.8522
4:      Age on SR   0.41 51.63  0.21  0.8317      0.05      0.05 0.8100
   EffSize.Boot
1:         0.02
2:         0.03
3:         0.05
4:         0.05

$DetallSimple[[1]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.03 52.24 -0.02  0.9842      0.03      0.00 0.9844
2:   Sleep on Old   0.02 43.54  0.01  0.9940      0.03      0.00 0.9967
3: Age on Control   0.36 34.15  0.20  0.8419      0.05      0.04 0.8500
4:      Age on SR   0.41 51.63  0.21  0.8317      0.04      0.05 0.8411
5:      YSR vs OC   0.39 44.63  0.19  0.8484      0.05      0.04 0.8489
   EffSize.Boot
1:         0.03
2:         0.03
3:         0.06
4:         0.04
5:         0.05


$DetallSimple[[2]]
$DetallSimple[[2]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 0.34 0.562   0.34  0.562  0.04 0.8372 0.5693        0.539       
2:     Sleep 1.42 0.238   1.42  0.238  1.24 0.2668 0.2270        0.224       
3: Age*Sleep 0.00 0.964   0.01  0.910  0.04 0.8411 0.8080        0.962       
   EffSize
1:    0.05
2:    0.13
3:    0.04

$DetallSimple[[2]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   1.31 58.90  1.01  0.3189      0.14      1.01 0.3189
2:   Sleep on Old   1.41 36.66  0.75  0.4565      0.15      0.57 0.4622
3: Age on Control  -0.72 32.58 -0.40  0.6886      0.07      0.16 0.6944
4:      Age on SR  -0.61 52.40 -0.43  0.6701      0.06      0.18 0.6922
   EffSize.Boot
1:         0.15
2:         0.14
3:         0.08
4:         0.06

$DetallSimple[[2]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   1.31 58.90  1.01  0.3189      0.15      1.01 0.3111
2:   Sleep on Old   1.41 36.66  0.75  0.4565      0.14      0.57 0.4933
3: Age on Control  -0.72 32.58 -0.40  0.6886      0.07      0.16 0.6856
4:      Age on SR  -0.61 52.40 -0.43  0.6701      0.06      0.18 0.6844
5:      YSR vs OC  -2.03 37.18 -1.08  0.2854      0.15      1.17 0.3044
   EffSize.Boot
1:         0.15
2:         0.13
3:         0.08
4:         0.07
5:         0.17


$DetallSimple[[3]]
$DetallSimple[[3]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 0.02 0.886   0.02  0.886  0.03 0.8728 0.8781        0.888       
2:     Sleep 0.06 0.802   0.06  0.802  0.11 0.7365 0.7780        0.798       
3: Age*Sleep 1.07 0.304   0.08  0.390  0.80 0.3728 0.3472        0.304       
   EffSize
1:    0.03
2:    0.01
3:    0.14

$DetallSimple[[3]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.86 47.07 -0.54  0.5940      0.08      0.29 0.5900
2:   Sleep on Old   1.42 44.99  0.94  0.3530      0.16      0.88 0.3500
3: Age on Control  -0.98 44.46 -0.75  0.4553      0.14      0.57 0.4744
4:      Age on SR   1.30 52.12  0.73  0.4686      0.10      0.53 0.4989
   EffSize.Boot
1:         0.08
2:         0.15
3:         0.12
4:         0.11

$DetallSimple[[3]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.86 47.07 -0.54  0.5940      0.09      0.29 0.5944
2:   Sleep on Old   1.42 44.99  0.94  0.3530      0.15      0.88 0.3433
3: Age on Control  -0.98 44.46 -0.75  0.4553      0.10      0.57 0.4422
4:      Age on SR   1.30 52.12  0.73  0.4686      0.11      0.53 0.4578
5:      YSR vs OC  -0.12 49.06 -0.07  0.9458      0.05      0.00 0.9467
   EffSize.Boot
1:         0.09
2:         0.15
3:         0.11
4:         0.11
5:         0.06


$DetallSimple[[4]]
$DetallSimple[[4]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 2.61 0.110   2.61   0.11  2.04 0.1556 0.0868        0.089       
2:     Sleep 0.34 0.560   0.34   0.56  0.16 0.6933 0.5342        0.564       
3: Age*Sleep 0.00 0.996  -0.01   0.90  0.05 0.8314 0.9850        0.996       
   EffSize
1:    0.18
2:    0.06
3:    0.02

$DetallSimple[[4]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.54 56.21 -0.40  0.6930      0.06      0.16 0.7056
2:   Sleep on Old  -0.55 40.91 -0.43  0.6669      0.09      0.19 0.6733
3: Age on Control   1.51 55.39  1.39  0.1686      0.21      1.95 0.1522
4:      Age on SR   1.50 52.79  0.99  0.3276      0.16      0.98 0.3178
   EffSize.Boot
1:         0.06
2:         0.09
3:         0.22
4:         0.16

$DetallSimple[[4]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.54 56.21 -0.40  0.6930      0.05      0.16 0.6833
2:   Sleep on Old  -0.55 40.91 -0.43  0.6669      0.09      0.19 0.6822
3: Age on Control   1.51 55.39  1.39  0.1686      0.21      1.95 0.1622
4:      Age on SR   1.50 52.79  0.99  0.3276      0.15      0.98 0.3156
5:      YSR vs OC   2.06 47.02  1.58  0.1210      0.25      2.49 0.1311
   EffSize.Boot
1:         0.06
2:         0.08
3:         0.19
4:         0.15
5:         0.25


$DetallSimple[[5]]
$DetallSimple[[5]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1 pBoot Sig pBootMas SigMas
1:       Age 0.08 0.774   0.08  0.774  0.29 0.5910    NA            1       
2:     Sleep 0.42 0.520   0.42  0.520  0.25 0.6203    NA            0  *    
3: Age*Sleep 0.00 0.999   0.00  0.970  0.39 0.5326    NA            0  *    
   EffSize
1:    0.05
2:    0.09
3:    0.02

$DetallSimple[[5]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.64 51.12 -0.55  0.5837      0.09      0.30 0.5744
2:   Sleep on Old  -0.64 40.96 -0.40  0.6910      0.07      0.16 0.6978
3: Age on Control  -0.28 31.80 -0.20  0.8422      0.05      0.04 0.8389
4:      Age on SR  -0.29 52.36 -0.21  0.8366      0.04      0.04 0.8311
   EffSize.Boot
1:         0.09
2:         0.07
3:         0.05
4:         0.04

$DetallSimple[[5]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.64 51.12 -0.55  0.5837      0.09      0.30 0.5900
2:   Sleep on Old  -0.64 40.96 -0.40  0.6910      0.07      0.16 0.6922
3: Age on Control  -0.28 31.80 -0.20  0.8422      0.04      0.04 0.8356
4:      Age on SR  -0.29 52.36 -0.21  0.8366      0.04      0.04 0.8544
5:      YSR vs OC   0.36 42.28  0.22  0.8245      0.06      0.05 0.8389
   EffSize.Boot
1:         0.09
2:         0.06
3:         0.04
4:         0.04
5:         0.04
Omnibus AOV. Design 2x2x(5xS)
Names Q p pBoot Sig pBootMas Sig2
Age 0.12 0.7267 0.7129 0.7273
Sleep 0.02 0.8851 0.8948 0.8835
Time 0.48 0.7476 0.2287 0.3148
Age*Sleep 0.14 0.7101 0.7028 0.8478
Age*Time 0.32 0.8647 0.4541 0.5307
Sleep*Time 0.20 0.9370 0.6611 0.7329
AgeSleepTime 0.11 0.9805 0.8865 0.9020
Interaction Age-Sleep. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1
Sleep on Young -0.77 245.45 -0.24 0.8082 0.10
Sleep on Old 1.65 184.45 0.44 0.6634 0.06
Age on Control -0.11 153.44 -0.03 0.9739 0.11
Age on SR 2.31 244.51 0.64 0.5236 0.06
Interaction Age-Time. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1
Age on M1 0.77 84.00 0.29 0.7700 0.03
Age on M2 -1.33 70.26 -0.58 0.5613 0.04
Age on M3 0.32 91.93 0.14 0.8851 0.03
Age on M4 3.02 96.36 1.61 0.1097 0.17
Age on M5 -0.57 78.02 -0.29 0.7738 0.05
M1-M2 on Young 3.47 NA 1.48 0.1541 0.05
M1-M2 on Old 1.23 NA 0.38 0.7104 0.02
M2-M3 on Young -2.05 NA -1.92 0.0683 0.07
M2-M3 on Old -1.62 NA -0.55 0.5871 0.02
M3-M4 on Young -0.47 NA -0.26 0.7992 0.06
M3-M4 on Old 3.73 NA 2.14 0.0445 0.23
M4-M5 on Young -0.44 NA -0.19 0.8482 0.03
M4-M5 on Old -4.40 NA -1.67 0.1107 0.19
Interaction Sleep-Time. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1
Sleep on M1 -0.02 84.00 -0.01 0.9954 0.01
Sleep on M2 2.72 70.26 1.19 0.2376 0.13
Sleep on M3 0.56 91.93 0.25 0.8015 0.01
Sleep on M4 -1.10 96.36 -0.59 0.5593 0.05
Sleep on M5 -1.28 78.02 -0.65 0.5190 0.09
M1-M2 on Young 1.55 NA 0.61 0.5488 0.04
M1-M2 on Old 4.16 NA 1.52 0.1443 0.08
M2-M3 on Young -0.69 NA -0.48 0.6334 0.00
M2-M3 on Old -3.68 NA -2.31 0.0311 0.11
M3-M4 on Young 2.77 NA 1.40 0.1774 0.19
M3-M4 on Old 1.53 NA 0.81 0.4278 0.09
M4-M5 on Young -0.59 NA -0.29 0.7775 0.07
M4-M5 on Old -2.94 NA -1.13 0.2712 0.08
Main Effect Time. Design 2x2x(5xS)
Contr psihat test p.value Psihat2 p.value2 EfSize.V1
M1-M2 4.84 1.03 0.3140 0.27 0.848 0.02
M2-M3 -2.52 -0.83 0.4162 -1.93 0.444 0.05
M3-M4 1.73 0.85 0.4074 5.62 0.052 0.13
M4-M5 -2.95 -0.75 0.4589 -3.24 0.476 0.07
Simple Effect Time each Age-Sleep condition. Design 2x2x(5xS)
Contr psihat df test p.value Psihat2 p.value2 dif.yuen df.yuen test.yuen EffSize.yuen pvaluet.yuen
M1-M2 on Y_C 0.32 NA 0.46 0.6497 -0.08 0.968 -0.08 35 -0.08 0.01 0.9347
M1-M2 on Y_SR 1.47 NA 1.50 0.1492 1.26 0.400 1.26 29 0.92 0.13 0.3655
M1-M2 on O_C -1.24 NA -0.84 0.4125 -1.16 0.580 -1.16 21 -0.52 0.09 0.6060
M1-M2 on O_SR 0.72 NA 0.92 0.3658 0.24 0.704 0.24 24 0.20 0.03 0.8447
M2-M3 on Y_C -0.01 NA -0.01 0.9908 0.19 0.832 0.19 35 0.19 0.02 0.8502
M2-M3 on Y_SR -1.46 NA -2.17 0.0414 -1.98 0.212 -1.98 29 -1.47 0.16 0.1518
M2-M3 on O_C 0.26 NA 0.17 0.8669 -0.07 0.912 -0.07 21 -0.04 0.01 0.9649
M2-M3 on O_SR -0.97 NA -0.70 0.4911 -0.07 0.820 -0.07 24 -0.05 0.01 0.9623
M3-M4 on Y_C -0.19 NA -0.40 0.6917 0.57 0.564 0.57 35 0.62 0.07 0.5377
M3-M4 on Y_SR -0.06 NA -0.04 0.9675 0.89 0.572 0.89 29 0.58 0.08 0.5638
M3-M4 on O_C 2.31 NA 1.98 0.0605 3.06 0.052 3.06 21 2.49 0.42 0.0211
M3-M4 on O_SR 0.28 NA 0.45 0.6564 1.09 0.452 1.09 24 1.06 0.12 0.2983
M4-M5 on Y_C -0.69 NA -0.42 0.6823 0.14 0.868 -0.03 32 -0.02 0.04 0.9823
M4-M5 on Y_SR 0.13 NA 0.14 0.8907 0.04 1.000 0.04 29 0.04 0.00 0.9703
M4-M5 on O_C -1.28 NA -0.93 0.3633 -1.66 0.356 -1.66 21 -1.09 0.18 0.2890
M4-M5 on O_SR -2.65 NA -1.82 0.0826 -1.75 0.476 -1.75 24 -1.13 0.19 0.2682
Simple Effect Age-Sleep on Time=1 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.09 0.771 0.09 0.771 0.07 0.7860 0.7646 0.766 0.04
Sleep 0.00 0.996 0.00 0.996 0.00 0.9655 0.9933 0.997 0.01
Age*Sleep 0.00 0.986 -0.02 0.780 0.03 0.8606 0.9850 0.985 0.01
Simple Effect Age-Sleep on Time=1 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.03 52.24 -0.02 0.9842 0.03 0.00 0.9800 0.02
Sleep on Old 0.02 43.54 0.01 0.9940 0.03 0.00 0.9878 0.03
Age on Control 0.36 34.15 0.20 0.8419 0.05 0.04 0.8522 0.05
Age on SR 0.41 51.63 0.21 0.8317 0.05 0.05 0.8100 0.05
Simple Effect Age-Sleep on Time=1 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.03 52.24 -0.02 0.9842 0.03 0.00 0.9844 0.03
Sleep on Old 0.02 43.54 0.01 0.9940 0.03 0.00 0.9967 0.03
Age on Control 0.36 34.15 0.20 0.8419 0.05 0.04 0.8500 0.06
Age on SR 0.41 51.63 0.21 0.8317 0.04 0.05 0.8411 0.04
YSR vs OC 0.39 44.63 0.19 0.8484 0.05 0.04 0.8489 0.05
Simple Effect Age-Sleep on Time=2 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.34 0.562 0.34 0.562 0.04 0.8372 0.5693 0.539 0.05
Sleep 1.42 0.238 1.42 0.238 1.24 0.2668 0.2270 0.224 0.13
Age*Sleep 0.00 0.964 0.01 0.910 0.04 0.8411 0.8080 0.962 0.04
Simple Effect Age-Sleep on Time=2 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 1.31 58.90 1.01 0.3189 0.14 1.01 0.3189 0.15
Sleep on Old 1.41 36.66 0.75 0.4565 0.15 0.57 0.4622 0.14
Age on Control -0.72 32.58 -0.40 0.6886 0.07 0.16 0.6944 0.08
Age on SR -0.61 52.40 -0.43 0.6701 0.06 0.18 0.6922 0.06
Simple Effect Age-Sleep on Time=2 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 1.31 58.90 1.01 0.3189 0.15 1.01 0.3111 0.15
Sleep on Old 1.41 36.66 0.75 0.4565 0.14 0.57 0.4933 0.13
Age on Control -0.72 32.58 -0.40 0.6886 0.07 0.16 0.6856 0.08
Age on SR -0.61 52.40 -0.43 0.6701 0.06 0.18 0.6844 0.07
YSR vs OC -2.03 37.18 -1.08 0.2854 0.15 1.17 0.3044 0.17
Simple Effect Age-Sleep on Time=3 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.02 0.886 0.02 0.886 0.03 0.8728 0.8781 0.888 0.03
Sleep 0.06 0.802 0.06 0.802 0.11 0.7365 0.7780 0.798 0.01
Age*Sleep 1.07 0.304 0.08 0.390 0.80 0.3728 0.3472 0.304 0.14
Simple Effect Age-Sleep on Time=3 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.86 47.07 -0.54 0.5940 0.08 0.29 0.5900 0.08
Sleep on Old 1.42 44.99 0.94 0.3530 0.16 0.88 0.3500 0.15
Age on Control -0.98 44.46 -0.75 0.4553 0.14 0.57 0.4744 0.12
Age on SR 1.30 52.12 0.73 0.4686 0.10 0.53 0.4989 0.11
Simple Effect Age-Sleep on Time=3 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.86 47.07 -0.54 0.5940 0.09 0.29 0.5944 0.09
Sleep on Old 1.42 44.99 0.94 0.3530 0.15 0.88 0.3433 0.15
Age on Control -0.98 44.46 -0.75 0.4553 0.10 0.57 0.4422 0.11
Age on SR 1.30 52.12 0.73 0.4686 0.11 0.53 0.4578 0.11
YSR vs OC -0.12 49.06 -0.07 0.9458 0.05 0.00 0.9467 0.06
Simple Effect Age-Sleep on Time=4 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 2.61 0.110 2.61 0.11 2.04 0.1556 0.0868 0.089 0.18
Sleep 0.34 0.560 0.34 0.56 0.16 0.6933 0.5342 0.564 0.06
Age*Sleep 0.00 0.996 -0.01 0.90 0.05 0.8314 0.9850 0.996 0.02
Simple Effect Age-Sleep on Time=4 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.54 56.21 -0.40 0.6930 0.06 0.16 0.7056 0.06
Sleep on Old -0.55 40.91 -0.43 0.6669 0.09 0.19 0.6733 0.09
Age on Control 1.51 55.39 1.39 0.1686 0.21 1.95 0.1522 0.22
Age on SR 1.50 52.79 0.99 0.3276 0.16 0.98 0.3178 0.16
Simple Effect Age-Sleep on Time=4 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.54 56.21 -0.40 0.6930 0.05 0.16 0.6833 0.06
Sleep on Old -0.55 40.91 -0.43 0.6669 0.09 0.19 0.6822 0.08
Age on Control 1.51 55.39 1.39 0.1686 0.21 1.95 0.1622 0.19
Age on SR 1.50 52.79 0.99 0.3276 0.15 0.98 0.3156 0.15
YSR vs OC 2.06 47.02 1.58 0.1210 0.25 2.49 0.1311 0.25
Simple Effect Age-Sleep on Time=5 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.08 0.774 0.08 0.774 0.29 0.5910 NA 1 0.05
Sleep 0.42 0.520 0.42 0.520 0.25 0.6203 NA 0
0.09
Age*Sleep 0.00 0.999 0.00 0.970 0.39 0.5326 NA 0
0.02
Simple Effect Age-Sleep on Time=5 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.64 51.12 -0.55 0.5837 0.09 0.30 0.5744 0.09
Sleep on Old -0.64 40.96 -0.40 0.6910 0.07 0.16 0.6978 0.07
Age on Control -0.28 31.80 -0.20 0.8422 0.05 0.04 0.8389 0.05
Age on SR -0.29 52.36 -0.21 0.8366 0.04 0.04 0.8311 0.04
Simple Effect Age-Sleep on Time=5 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.64 51.12 -0.55 0.5837 0.09 0.30 0.5900 0.09
Sleep on Old -0.64 40.96 -0.40 0.6910 0.07 0.16 0.6922 0.06
Age on Control -0.28 31.80 -0.20 0.8422 0.04 0.04 0.8356 0.04
Age on SR -0.29 52.36 -0.21 0.8366 0.04 0.04 0.8544 0.04
YSR vs OC 0.36 42.28 0.22 0.8245 0.06 0.05 0.8389 0.04

3.3 Fig 2C Average rate remapping for all groups across trials {Design 2x2x(4xS)}

  NmBas="Fig2C RateRemap"
  NmFAlL<-paste0(PathDesign,NmBas)
  if (!dir.exists(NmFAlL)) {dir.create(NmFAlL)}
  NmFAlL<-paste0(NmFAlL,"/")
  ResGen<-NA
  
  rrt<-ExDataIS.2(nmF = paste0(PathDesign,"Parameters.csv"),Vars = ,c(1,5,6,32:35),vIntP =c(4:7),lvlCh = list("HABxT1"="RatRemap_Hab.S1", "T1xT2"="RatRemap_S1.S2","T2xT3"="RatRemap_S2.S3","T3xTest"="RatRemap_S3.test"))
  DatDT<-rrt$DT
  ArP<-rrt$Arp
  ExtendDT<-rrt$ExtendDT
  
  # Para Ef Simples:
  DatEfS<-list()
  for(is in 1:4) {
    DatEfS[[is]]<-ExData.2(nmF = paste0(PathDesign,"Parameters.csv"),Vars = c(5,6,(31+is)))
    names(DatEfS[[is]]$DT)[3]<-"DepV"
  }
  
  Grp<- Grph.3(DatP = ExtendDT,"OPR",LblsP =c("Rate and Global Remapping", "","Rate Remapping (Hz)"),ylmP =c(0,6),hLin = F,lvIp = 4)
  
  levBp<-seq(0.7, 5, by=0.2)
  Grp2<- Grp + geom_signif(annotation="*",
              y_position=5, xmin=levBp[1+15]  , xmax=levBp[2+15], 
              tip_length = c(0.02, 0.02),textsize=6) +
    geom_signif(annotation="*",
              y_position=5.2, xmin=levBp[2+15]  , xmax=levBp[4+15], 
              tip_length = c(0.02, 0.02),textsize=6)+
    geom_signif(annotation="*",
              y_position=4.8, xmin=levBp[1+10]  , xmax=levBp[1+15], 
              tip_length = c(0.02, 0.02),textsize=6)+
    geom_signif(annotation="*",
              y_position=5.5, xmin=levBp[4+10]  , xmax=levBp[4+15], 
              tip_length = c(0.02, 0.02),textsize=6)
  
    #AOV
    names(rrt$DT)[4:7]<-c("T1","T2","T3","T4")
    ResGen<-AOVMx2(A=2,B=2,C=4,DatPas = rrt,DatEfSp = DatEfS,nBMM1 = 10000,nBMM2 = 1000,Prc = 2)
    AlmacenGen2(GrpP = Grp,Grp2P = Grp2,DataPas = ResGen,PathDesignP = PathDesign,NmBasP = NmBas,Typ=2)
  
  # Other Graphs
    GrpO<-Grph.3.Otros(ExtendDT,LblsP =c("Rate and Global Remapping", "A","Rate Remapping (Hz)"))
    
    ExtendDTCol<-copy(ExtendDT)
    ExtendDTCol$Moment<-"All"
    ExtendDTCol<-data.table(rbind(ExtendDT,ExtendDTCol))
  
    Grp3<-Grph.3(DatP = ExtendDTCol,"OPR",LblsP =c("Rate and Global Remapping", "A","Rate Remapping (Hz)"),ylmP=c(0,6), hLin = F,lvIp = 5,wMain = T)
   
    pdf(paste0(NmFAlL,NmBas,"OtrosGraphs.pdf"))
      Grp3
      GrpO
    dev.off()

        # Results
        plot(Grp)
        plot(Grp2) # Only this graph is printed in the html file.
        GrpO
        plot(Grp3)
        ResGen # Lean option to view the results of statistical analysis
        
        Kbl3(ResPas = ResGen[[1]], lbl = "Omnibus AOV. Design 2x2x(4xS)");cat("\n")
        Kbl3(ResGen[[2]], "Interaction Age-Sleep. Design 2x2x(4xS)")
        Kbl3(ResGen[[3]], "Interaction Age-Time. Design 2x2x(4xS)")
        Kbl3(ResGen[[4]], "Interaction Sleep-Time. Design 2x2x(4xS)")
        Kbl3(ResGen[[5]], "Main Effect Time. Design 2x2x(4xS)")
        Kbl3(ResGen[[6]], "Simple Effect Time each Age-Sleep condition. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[1]][[1]], "Simple Effect Age-Sleep on Time=1 Omnibus AOV. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[1]][[2]], "Simple Effect Age-Sleep on Time=1 Simple Effects. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[1]][[3]], "Simple Effect Age-Sleep on Time=1 Extense Simple Effects. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[2]][[1]], "Simple Effect Age-Sleep on Time=2 Omnibus AOV. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[2]][[2]], "Simple Effect Age-Sleep on Time=2 Simple Effects. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[2]][[3]], "Simple Effect Age-Sleep on Time=2 Extense Simple Effects. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[3]][[1]], "Simple Effect Age-Sleep on Time=3 Omnibus AOV. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[3]][[2]], "Simple Effect Age-Sleep on Time=3 Simple Effects. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[3]][[3]], "Simple Effect Age-Sleep on Time=3 Extense Simple Effects. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[4]][[1]], "Simple Effect Age-Sleep on Time=4 Omnibus AOV. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[4]][[2]], "Simple Effect Age-Sleep on Time=4 Simple Effects. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[4]][[3]], "Simple Effect Age-Sleep on Time=4 Extense Simple Effects. Design 2x2x(4xS)")
           Eff   p.V1 p.Sig
1:   p.value.A 0.0000 *    
2:   p.value.B 0.9299      
3:   p.value.C 0.0100 *    
4:  p.value.AB 0.2321      
5:  p.value.AC 0.2871      
6:  p.value.BC 0.8297      
7: p.value.ABC 0.0751      
           Eff   p.V1 p.Sig
1:   p.value.A 0.0019 *    
2:   p.value.B 0.9259      
3:   p.value.C 0.0152 *    
4:  p.value.AB 0.0603      
5:  p.value.AC 0.3640      
6:  p.value.BC 0.8563      
7: p.value.ABC 0.0846      
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
$BP

$Bars

$MargAB

$MargAC

$MargBC

$MargC

quartz_off_screen 
                2 
$BP

$Bars

$MargAB

$MargAC

$MargBC

$MargC

$AOV
            Names     Q      p  pBoot   Sig pBootMas  Sig2
1:            Age 10.20 0.0015 0.0000 *       0.0019 *    
2:          Sleep  0.01 0.9257 0.9299         0.9259      
3:           Time  2.12 0.0958 0.0100 *       0.0152 *    
4:      Age*Sleep  1.45 0.2282 0.2321         0.0603      
5:       Age*Time  0.62 0.6036 0.2871         0.3640      
6:     Sleep*Time  0.15 0.9300 0.8297         0.8563      
7: Age*Sleep*Time  1.30 0.2738 0.0751         0.0846      

$InterAB
            Contr psihat     df  test p.value EfSize.V1
1: Sleep on Young   0.52 188.23  1.35  0.1771      0.17
2:   Sleep on Old  -0.44 144.54 -0.91  0.3663      0.09
3: Age on Control  -0.79 178.34 -1.78  0.0760      0.19
4:      Age on SR  -1.74 121.50 -4.04  0.0001      0.44

$InterAC
             Contr psihat    df  test p.value EfSize.V1
 1:      Age on M1  -0.50 93.44 -1.77  0.0796      0.20
 2:      Age on M2  -0.33 91.19 -1.16  0.2492      0.11
 3:      Age on M3  -0.55 75.72 -2.13  0.0363      0.25
 4:      Age on M4  -1.15 78.47 -2.94  0.0044      0.33
 5: M1-M2 on Young  -0.11    NA -0.40  0.6954      0.09
 6:   M1-M2 on Old  -0.04    NA -0.14  0.8864      0.00
 7: M2-M3 on Young   0.04    NA  0.21  0.8319      0.12
 8:   M2-M3 on Old  -0.12    NA -0.46  0.6479      0.00
 9: M3-M4 on Young  -0.77    NA -2.25  0.0352      0.13
10:   M3-M4 on Old  -0.79    NA -2.90  0.0085      0.28

$InterBC
               Contr psihat    df  test p.value EfSize.V1
 1:      Sleep on M1  -0.19 93.44 -0.66  0.5081      0.08
 2:      Sleep on M2   0.10 91.19  0.34  0.7339      0.02
 3:      Sleep on M3   0.09 75.72  0.34  0.7337      0.04
 4:      Sleep on M4   0.08 78.47  0.19  0.8464      0.08
 5: M1-M2 on Control  -0.42    NA -1.54  0.1397      0.09
 6:      M1-M2 on SR   0.31    NA  1.44  0.1658      0.00
 7: M2-M3 on Control   0.10    NA  0.40  0.6912      0.06
 8:      M2-M3 on SR  -0.33    NA -1.25  0.2233      0.08
 9: M3-M4 on Control  -0.89    NA -2.34  0.0294      0.24
10:      M3-M4 on SR  -0.74    NA -3.14  0.0049      0.15

$DetallMainC
   Contr psihat  test p.value Psihat2 p.value2 EfSize.V1
1: M1-M2  -0.21 -0.58  0.5671   -0.26    0.444      0.05
2: M2-M3  -0.29 -0.68  0.5042    0.29    0.468      0.06
3: M3-M4  -1.59 -2.83  0.0101   -1.36    0.000      0.20

$DetallTrialCadaCondAB
            Contr psihat df  test p.value Psihat2 p.value2 dif.yuen df.yuen
 1:  M1-M2 on Y_C  -0.20 NA -1.48  0.1533   -0.12    0.428    -0.12      35
 2: M1-M2 on Y_SR   0.11 NA  0.71  0.4848   -0.09    0.500    -0.09      29
 3:  M1-M2 on O_C  -0.09 NA -0.48  0.6334   -0.15    0.528    -0.15      21
 4: M1-M2 on O_SR   0.00 NA -0.03  0.9797    0.11    0.612     0.11      24
 5:  M2-M3 on Y_C   0.06 NA  0.56  0.5840    0.08    0.440     0.08      35
 6: M2-M3 on Y_SR   0.02 NA  0.15  0.8822    0.17    0.132     0.17      29
 7:  M2-M3 on O_C   0.07 NA  0.47  0.6398    0.07    0.788     0.07      21
 8: M2-M3 on O_SR  -0.29 NA -2.19  0.0397   -0.03    0.824    -0.03      24
 9:  M3-M4 on Y_C  -0.51 NA -1.68  0.1068   -0.43    0.004    -0.43      35
10: M3-M4 on Y_SR   0.03 NA  0.34  0.7402    0.05    0.652     0.05      29
11:  M3-M4 on O_C  -0.18 NA -0.88  0.3910   -0.24    0.340    -0.24      21
12: M3-M4 on O_SR  -0.75 NA -2.80  0.0107   -0.74    0.008    -0.74      24
    test.yuen EffSize.yuen pvaluet.yuen
 1:     -0.75         0.08       0.4586
 2:     -0.66         0.08       0.5169
 3:     -0.67         0.11       0.5083
 4:      0.72         0.09       0.4815
 5:      0.62         0.08       0.5362
 6:      1.41         0.16       0.1680
 7:      0.38         0.05       0.7094
 8:     -0.16         0.03       0.8760
 9:     -2.03         0.28       0.0503
10:      0.54         0.06       0.5905
11:     -1.17         0.19       0.2557
12:     -2.57         0.39       0.0167

$DetallSimple
$DetallSimple[[1]]
$DetallSimple[[1]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 3.14 0.080   3.14  0.080  2.50 0.1159 0.0668        0.064       
2:     Sleep 0.44 0.509   0.44  0.509  0.47 0.4920 0.4674        0.506       
3: Age*Sleep 0.07 0.795   0.01  0.930  0.01 0.9290 0.8314        0.783       
   EffSize
1:    0.18
2:    0.08
3:    0.03

$DetallSimple[[1]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.06 63.51 -0.32  0.7485      0.06      0.10 0.7511
2:   Sleep on Old  -0.13 44.74 -0.59  0.5560      0.10      0.35 0.5767
3: Age on Control  -0.21 48.10 -1.03  0.3084      0.17      1.06 0.3022
4:      Age on SR  -0.29 45.58 -1.50  0.1413      0.22      2.24 0.1433
   EffSize.Boot
1:         0.06
2:         0.10
3:         0.16
4:         0.21

$DetallSimple[[1]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.06 63.51 -0.32  0.7485      0.05      0.10 0.7633
2:   Sleep on Old  -0.13 44.74 -0.59  0.5560      0.10      0.35 0.5467
3: Age on Control  -0.21 48.10 -1.03  0.3084      0.16      1.06 0.3078
4:      Age on SR  -0.29 45.58 -1.50  0.1413      0.22      2.24 0.1556
5:      YSR vs OC  -0.16 40.57 -0.81  0.4225      0.13      0.66 0.4244
   EffSize.Boot
1:         0.06
2:         0.10
3:         0.16
4:         0.22
5:         0.13


$DetallSimple[[2]]
$DetallSimple[[2]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 1.34 0.250   1.34  0.250  0.85 0.3581 0.2504        0.235       
2:     Sleep 0.12 0.734   0.12  0.734  0.03 0.8644 0.7496        0.718       
3: Age*Sleep 0.31 0.581   0.06  0.510  0.33 0.5677 0.6444        0.577       
   EffSize
1:    0.11
2:    0.02
3:    0.09

$DetallSimple[[2]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.03 63.86 -0.16  0.8742      0.03      0.03 0.8722
2:   Sleep on Old   0.13 38.86  0.60  0.5499      0.10      0.36 0.5444
3: Age on Control  -0.24 46.90 -1.09  0.2830      0.19      1.18 0.2867
4:      Age on SR  -0.09 52.73 -0.49  0.6241      0.07      0.24 0.6467
   EffSize.Boot
1:         0.03
2:         0.10
3:         0.17
4:         0.09

$DetallSimple[[2]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.03 63.86 -0.16  0.8742      0.04      0.03 0.8867
2:   Sleep on Old   0.13 38.86  0.60  0.5499      0.11      0.36 0.5667
3: Age on Control  -0.24 46.90 -1.09  0.2830      0.18      1.18 0.2533
4:      Age on SR  -0.09 52.73 -0.49  0.6241      0.07      0.24 0.6189
5:      YSR vs OC  -0.21 40.76 -1.00  0.3216      0.15      1.01 0.3367
   EffSize.Boot
1:         0.04
2:         0.10
3:         0.17
4:         0.08
5:         0.16


$DetallSimple[[3]]
$DetallSimple[[3]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot   Sig pBootMas SigMas
1:       Age 4.54 0.037   4.54  0.037  4.49 0.0357 0.0250 *        0.029  *    
2:     Sleep 0.12 0.734   0.12  0.734  1.26 0.2640 0.7379          0.729       
3: Age*Sleep 0.01 0.913   0.01  0.900  0.04 0.8353 0.8214          0.908       
   EffSize
1:    0.24
2:    0.04
3:    0.01

$DetallSimple[[3]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.06 61.84  0.41  0.6867      0.06      0.16 0.7078
2:   Sleep on Old   0.03 40.85  0.14  0.8898      0.04      0.02 0.9022
3: Age on Control  -0.26 45.95 -1.70  0.0957      0.26      2.89 0.0867
4:      Age on SR  -0.29 39.89 -1.39  0.1713      0.22      1.94 0.1567
   EffSize.Boot
1:         0.05
2:         0.03
3:         0.27
4:         0.22

$DetallSimple[[3]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.06 61.84  0.41  0.6867      0.05      0.16 0.6878
2:   Sleep on Old   0.03 40.85  0.14  0.8898      0.03      0.02 0.9011
3: Age on Control  -0.26 45.95 -1.70  0.0957      0.24      2.89 0.0844
4:      Age on SR  -0.29 39.89 -1.39  0.1713      0.23      1.94 0.1733
5:      YSR vs OC  -0.32 46.46 -2.00  0.0512      0.30      4.00 0.0311
   EffSize.Boot
1:         0.05
2:         0.04
3:         0.27
4:         0.21
5:         0.32


$DetallSimple[[4]]
$DetallSimple[[4]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot   Sig pBootMas SigMas
1:       Age 8.62 0.005   8.62  0.005 12.85 0.0004 0.0067 *        0.005  *    
2:     Sleep 0.04 0.847   0.04  0.847  0.95 0.3323 0.8364          0.853       
3: Age*Sleep 6.68 0.012  -0.22  0.010  6.57 0.0112 0.0050 *        0.018  *    
   EffSize
1:    0.34
2:    0.08
3:    0.43

$DetallSimple[[4]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.54 46.29  2.30  0.0261      0.36      5.29 0.0478
2:   Sleep on Old  -0.47 40.84 -1.50  0.1411      0.28      2.25 0.1211
3: Age on Control  -0.07 55.98 -0.25  0.8062      0.09      0.06 0.8156
4:      Age on SR  -1.08 29.79 -3.93  0.0005      0.58     15.48 0.0000
   EffSize.Boot
1:         0.36
2:         0.28
3:         0.07
4:         0.58

$DetallSimple[[4]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.54 46.29  2.30  0.0261      0.36      5.29 0.0267
2:   Sleep on Old  -0.47 40.84 -1.50  0.1411      0.29      2.25 0.1333
3: Age on Control  -0.07 55.98 -0.25  0.8062      0.08      0.06 0.7989
4:      Age on SR  -1.08 29.79 -3.93  0.0005      0.58     15.48 0.0011
5:      YSR vs OC  -0.61 32.25 -3.14  0.0036      0.46      9.88 0.0044
   EffSize.Boot
1:         0.36
2:         0.28
3:         0.08
4:         0.59
5:         0.47
Omnibus AOV. Design 2x2x(4xS)
Names Q p pBoot Sig pBootMas Sig2
Age 10.20 0.0015 0.0000
0.0019
Sleep 0.01 0.9257 0.9299 0.9259
Time 2.12 0.0958 0.0100
0.0152
Age*Sleep 1.45 0.2282 0.2321 0.0603
Age*Time 0.62 0.6036 0.2871 0.3640
Sleep*Time 0.15 0.9300 0.8297 0.8563
AgeSleepTime 1.30 0.2738 0.0751 0.0846
Interaction Age-Sleep. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1
Sleep on Young 0.52 188.23 1.35 0.1771 0.17
Sleep on Old -0.44 144.54 -0.91 0.3663 0.09
Age on Control -0.79 178.34 -1.78 0.0760 0.19
Age on SR -1.74 121.50 -4.04 0.0001 0.44
Interaction Age-Time. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1
Age on M1 -0.50 93.44 -1.77 0.0796 0.20
Age on M2 -0.33 91.19 -1.16 0.2492 0.11
Age on M3 -0.55 75.72 -2.13 0.0363 0.25
Age on M4 -1.15 78.47 -2.94 0.0044 0.33
M1-M2 on Young -0.11 NA -0.40 0.6954 0.09
M1-M2 on Old -0.04 NA -0.14 0.8864 0.00
M2-M3 on Young 0.04 NA 0.21 0.8319 0.12
M2-M3 on Old -0.12 NA -0.46 0.6479 0.00
M3-M4 on Young -0.77 NA -2.25 0.0352 0.13
M3-M4 on Old -0.79 NA -2.90 0.0085 0.28
Interaction Sleep-Time. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1
Sleep on M1 -0.19 93.44 -0.66 0.5081 0.08
Sleep on M2 0.10 91.19 0.34 0.7339 0.02
Sleep on M3 0.09 75.72 0.34 0.7337 0.04
Sleep on M4 0.08 78.47 0.19 0.8464 0.08
M1-M2 on Control -0.42 NA -1.54 0.1397 0.09
M1-M2 on SR 0.31 NA 1.44 0.1658 0.00
M2-M3 on Control 0.10 NA 0.40 0.6912 0.06
M2-M3 on SR -0.33 NA -1.25 0.2233 0.08
M3-M4 on Control -0.89 NA -2.34 0.0294 0.24
M3-M4 on SR -0.74 NA -3.14 0.0049 0.15
Main Effect Time. Design 2x2x(4xS)
Contr psihat test p.value Psihat2 p.value2 EfSize.V1
M1-M2 -0.21 -0.58 0.5671 -0.26 0.444 0.05
M2-M3 -0.29 -0.68 0.5042 0.29 0.468 0.06
M3-M4 -1.59 -2.83 0.0101 -1.36 0.000 0.20
Simple Effect Time each Age-Sleep condition. Design 2x2x(4xS)
Contr psihat df test p.value Psihat2 p.value2 dif.yuen df.yuen test.yuen EffSize.yuen pvaluet.yuen
M1-M2 on Y_C -0.20 NA -1.48 0.1533 -0.12 0.428 -0.12 35 -0.75 0.08 0.4586
M1-M2 on Y_SR 0.11 NA 0.71 0.4848 -0.09 0.500 -0.09 29 -0.66 0.08 0.5169
M1-M2 on O_C -0.09 NA -0.48 0.6334 -0.15 0.528 -0.15 21 -0.67 0.11 0.5083
M1-M2 on O_SR 0.00 NA -0.03 0.9797 0.11 0.612 0.11 24 0.72 0.09 0.4815
M2-M3 on Y_C 0.06 NA 0.56 0.5840 0.08 0.440 0.08 35 0.62 0.08 0.5362
M2-M3 on Y_SR 0.02 NA 0.15 0.8822 0.17 0.132 0.17 29 1.41 0.16 0.1680
M2-M3 on O_C 0.07 NA 0.47 0.6398 0.07 0.788 0.07 21 0.38 0.05 0.7094
M2-M3 on O_SR -0.29 NA -2.19 0.0397 -0.03 0.824 -0.03 24 -0.16 0.03 0.8760
M3-M4 on Y_C -0.51 NA -1.68 0.1068 -0.43 0.004 -0.43 35 -2.03 0.28 0.0503
M3-M4 on Y_SR 0.03 NA 0.34 0.7402 0.05 0.652 0.05 29 0.54 0.06 0.5905
M3-M4 on O_C -0.18 NA -0.88 0.3910 -0.24 0.340 -0.24 21 -1.17 0.19 0.2557
M3-M4 on O_SR -0.75 NA -2.80 0.0107 -0.74 0.008 -0.74 24 -2.57 0.39 0.0167
Simple Effect Age-Sleep on Time=1 Omnibus AOV. Design 2x2x(4xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 3.14 0.080 3.14 0.080 2.50 0.1159 0.0668 0.064 0.18
Sleep 0.44 0.509 0.44 0.509 0.47 0.4920 0.4674 0.506 0.08
Age*Sleep 0.07 0.795 0.01 0.930 0.01 0.9290 0.8314 0.783 0.03
Simple Effect Age-Sleep on Time=1 Simple Effects. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.06 63.51 -0.32 0.7485 0.06 0.10 0.7511 0.06
Sleep on Old -0.13 44.74 -0.59 0.5560 0.10 0.35 0.5767 0.10
Age on Control -0.21 48.10 -1.03 0.3084 0.17 1.06 0.3022 0.16
Age on SR -0.29 45.58 -1.50 0.1413 0.22 2.24 0.1433 0.21
Simple Effect Age-Sleep on Time=1 Extense Simple Effects. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.06 63.51 -0.32 0.7485 0.05 0.10 0.7633 0.06
Sleep on Old -0.13 44.74 -0.59 0.5560 0.10 0.35 0.5467 0.10
Age on Control -0.21 48.10 -1.03 0.3084 0.16 1.06 0.3078 0.16
Age on SR -0.29 45.58 -1.50 0.1413 0.22 2.24 0.1556 0.22
YSR vs OC -0.16 40.57 -0.81 0.4225 0.13 0.66 0.4244 0.13
Simple Effect Age-Sleep on Time=2 Omnibus AOV. Design 2x2x(4xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 1.34 0.250 1.34 0.250 0.85 0.3581 0.2504 0.235 0.11
Sleep 0.12 0.734 0.12 0.734 0.03 0.8644 0.7496 0.718 0.02
Age*Sleep 0.31 0.581 0.06 0.510 0.33 0.5677 0.6444 0.577 0.09
Simple Effect Age-Sleep on Time=2 Simple Effects. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.03 63.86 -0.16 0.8742 0.03 0.03 0.8722 0.03
Sleep on Old 0.13 38.86 0.60 0.5499 0.10 0.36 0.5444 0.10
Age on Control -0.24 46.90 -1.09 0.2830 0.19 1.18 0.2867 0.17
Age on SR -0.09 52.73 -0.49 0.6241 0.07 0.24 0.6467 0.09
Simple Effect Age-Sleep on Time=2 Extense Simple Effects. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.03 63.86 -0.16 0.8742 0.04 0.03 0.8867 0.04
Sleep on Old 0.13 38.86 0.60 0.5499 0.11 0.36 0.5667 0.10
Age on Control -0.24 46.90 -1.09 0.2830 0.18 1.18 0.2533 0.17
Age on SR -0.09 52.73 -0.49 0.6241 0.07 0.24 0.6189 0.08
YSR vs OC -0.21 40.76 -1.00 0.3216 0.15 1.01 0.3367 0.16
Simple Effect Age-Sleep on Time=3 Omnibus AOV. Design 2x2x(4xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 4.54 0.037 4.54 0.037 4.49 0.0357 0.0250
0.029
0.24
Sleep 0.12 0.734 0.12 0.734 1.26 0.2640 0.7379 0.729 0.04
Age*Sleep 0.01 0.913 0.01 0.900 0.04 0.8353 0.8214 0.908 0.01
Simple Effect Age-Sleep on Time=3 Simple Effects. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.06 61.84 0.41 0.6867 0.06 0.16 0.7078 0.05
Sleep on Old 0.03 40.85 0.14 0.8898 0.04 0.02 0.9022 0.03
Age on Control -0.26 45.95 -1.70 0.0957 0.26 2.89 0.0867 0.27
Age on SR -0.29 39.89 -1.39 0.1713 0.22 1.94 0.1567 0.22
Simple Effect Age-Sleep on Time=3 Extense Simple Effects. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.06 61.84 0.41 0.6867 0.05 0.16 0.6878 0.05
Sleep on Old 0.03 40.85 0.14 0.8898 0.03 0.02 0.9011 0.04
Age on Control -0.26 45.95 -1.70 0.0957 0.24 2.89 0.0844 0.27
Age on SR -0.29 39.89 -1.39 0.1713 0.23 1.94 0.1733 0.21
YSR vs OC -0.32 46.46 -2.00 0.0512 0.30 4.00 0.0311 0.32
Simple Effect Age-Sleep on Time=4 Omnibus AOV. Design 2x2x(4xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 8.62 0.005 8.62 0.005 12.85 0.0004 0.0067
0.005
0.34
Sleep 0.04 0.847 0.04 0.847 0.95 0.3323 0.8364 0.853 0.08
Age*Sleep 6.68 0.012 -0.22 0.010 6.57 0.0112 0.0050
0.018
0.43
Simple Effect Age-Sleep on Time=4 Simple Effects. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.54 46.29 2.30 0.0261 0.36 5.29 0.0478 0.36
Sleep on Old -0.47 40.84 -1.50 0.1411 0.28 2.25 0.1211 0.28
Age on Control -0.07 55.98 -0.25 0.8062 0.09 0.06 0.8156 0.07
Age on SR -1.08 29.79 -3.93 0.0005 0.58 15.48 0.0000 0.58
Simple Effect Age-Sleep on Time=4 Extense Simple Effects. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.54 46.29 2.30 0.0261 0.36 5.29 0.0267 0.36
Sleep on Old -0.47 40.84 -1.50 0.1411 0.29 2.25 0.1333 0.28
Age on Control -0.07 55.98 -0.25 0.8062 0.08 0.06 0.7989 0.08
Age on SR -1.08 29.79 -3.93 0.0005 0.58 15.48 0.0011 0.59
YSR vs OC -0.61 32.25 -3.14 0.0036 0.46 9.88 0.0044 0.47

3.4 Fig 2D Average global remapping (map similarity) for all groups across trials {Design 2x2x(4xS)}

  NmBas="Fig2D GlobalRemapAllCells"
  NmFAlL<-paste0(PathDesign,NmBas)
  if (!dir.exists(NmFAlL)) {dir.create(NmFAlL)}
  NmFAlL<-paste0(NmFAlL,"/")
  ResGen<-NA
  
  rrt<-ExDataIS.2b(nmF = paste0(PathDesign,"Cell_types (ANOVA_Overall_correlations).csv"),Vars = ,c(3,4,12,7:10),vIntP =c(4:7),lvlCh = list("HABxT1"="s1xs2", "T1xT2"="s2xs3","T2xT3"="s3xs4","T3xTest"="s4xs5"))
  DatDT<-rrt$DT
  ArP<-rrt$Arp
  ExtendDT<-rrt$ExtendDT
  
  # For Simple Effects:
  DatEfS<-list()
  for(is in 1:4) {
    DatEfS[[is]]<-ExData.2(nmF = paste0(PathDesign,"Parameters.csv"),Vars = c(5,6,(31+is)))
    names(DatEfS[[is]]$DT)[3]<-"DepV"
  }
  
  #Graphs
  Grp<- Grph.3(DatP = ExtendDT,"OPR",LblsP =c("Rate and Global Remapping", "","Similarity Score"),ylmP =c(-0.5,1),hLin = T,lvIp = 4)
  
  levBp<-seq(0.7, 5, by=0.2)
  Grp2<- Grp +
    geom_signif(annotation=c("","","*"),
              y_position=c(0.95,0.95,1),
              xmin=c(levBp[1],levBp[3], mean(levBp[c(1,2)])),
              xmax=c(levBp[2],levBp[4], mean(levBp[c(3,4)])), 
              tip_length = c(0.02, 0.02),vjust = 0.5,textsize=6)+
    geom_signif(annotation=c("","","*"),
              y_position=c(0.95,0.95,1),
              xmin=c(levBp[1+15],levBp[3+15], mean(levBp[c(1+15,2+15)])),
              xmax=c(levBp[2+15],levBp[4+15], mean(levBp[c(3+15,4+15)])), 
              tip_length = c(0.02, 0.02),vjust = .5,textsize=6)+
    geom_signif(annotation=c("","","*"),
              y_position=c(0.8,0.82,0.85),
              xmin=c(levBp[1+15],levBp[2+15], mean(levBp[c(1+15,3+15)])-.1),
              xmax=c(levBp[3+15],levBp[4+15], mean(levBp[c(2+15,4+15)])), 
              tip_length = c(0.02, 0.02),vjust = .5,textsize=6)+
    geom_signif(annotation=c("","","*"),
              y_position=c(-0.45,-0.45,-0.5),
              xmin=c(levBp[1],levBp[1+5], mean(levBp[c(1,4)])),
              xmax=c(levBp[4],levBp[4+5], mean(levBp[c(1+5,4+5)])), 
              tip_length = c(-0.02, -0.02),vjust = 2,textsize=6)+
    geom_signif(annotation=c("","","*"),
              y_position=c(-0.45,-0.45,-0.5),
              xmin=c(levBp[1+10],levBp[1+15], mean(levBp[c(1+10,4+10)])),
              xmax=c(levBp[4+10],levBp[4+15], mean(levBp[c(1+15,4+15)])), 
              tip_length = c(-0.02, -0.02),vjust = 2,textsize=6)
  
    #AOV
    names(rrt$DT)[4:7]<-c("T1","T2","T3","T4")
    ResGen<-AOVMx2(A=2,B=2,C=4,DatPas = rrt,DatEfSp = DatEfS,nBMM1 = 10000,nBMM2 = 1000,Prc = 2)
    AlmacenGen2(GrpP = Grp,Grp2P = Grp2,DataPas = ResGen,PathDesignP = PathDesign,NmBasP = NmBas,Typ=2)
  
  # Other Graphs
    GrpO<-Grph.3.Otros(ExtendDT,LblsP =c("Rate and Global Remapping", "B","Similarity Score"))
    
    ExtendDTCol<-copy(ExtendDT)
    ExtendDTCol$Moment<-"All"
    ExtendDTCol<-data.table(rbind(ExtendDT,ExtendDTCol))
    Grp3<-Grph.3(DatP = ExtendDTCol,"OPR",LblsP =c("Rate and Global Remapping", "B","Similarity Score"),ylmP=c(-0.5,1), hLin = T,lvIp = 5,wMain = T)
    
    pdf(paste0(NmFAlL,NmBas,"OtrosGraphs.pdf"))
      Grp3
      GrpO
    dev.off()
    
        # Results
        plot(Grp)
        plot(Grp2) # Only this graph is printed in the html file.
        GrpO
        plot(Grp3)
        ResGen # Lean option to view the results of statistical analysis
        
        Kbl3(ResPas = ResGen[[1]], lbl = "Omnibus AOV. Design 2x2x(4xS)");cat("\n")
        Kbl3(ResGen[[2]], "Interaction Age-Sleep. Design 2x2x(4xS)")
        Kbl3(ResGen[[3]], "Interaction Age-Time. Design 2x2x(4xS)")
        Kbl3(ResGen[[4]], "Interaction Sleep-Time. Design 2x2x(4xS)")
        Kbl3(ResGen[[5]], "Main Effect Time. Design 2x2x(4xS)")
        Kbl3(ResGen[[6]], "Simple Effect Time each Age-Sleep condition. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[1]][[1]], "Simple Effect Age-Sleep on Time=1 Omnibus AOV. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[1]][[2]], "Simple Effect Age-Sleep on Time=1 Simple Effects. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[1]][[3]], "Simple Effect Age-Sleep on Time=1 Extense Simple Effects. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[2]][[1]], "Simple Effect Age-Sleep on Time=2 Omnibus AOV. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[2]][[2]], "Simple Effect Age-Sleep on Time=2 Simple Effects. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[2]][[3]], "Simple Effect Age-Sleep on Time=2 Extense Simple Effects. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[3]][[1]], "Simple Effect Age-Sleep on Time=3 Omnibus AOV. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[3]][[2]], "Simple Effect Age-Sleep on Time=3 Simple Effects. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[3]][[3]], "Simple Effect Age-Sleep on Time=3 Extense Simple Effects. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[4]][[1]], "Simple Effect Age-Sleep on Time=4 Omnibus AOV. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[4]][[2]], "Simple Effect Age-Sleep on Time=4 Simple Effects. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[4]][[3]], "Simple Effect Age-Sleep on Time=4 Extense Simple Effects. Design 2x2x(4xS)")
           Eff   p.V1 p.Sig
1:   p.value.A 0.0067 *    
2:   p.value.B 0.2254      
3:   p.value.C 0.0000 *    
4:  p.value.AB 0.3072      
5:  p.value.AC 0.0484 *    
6:  p.value.BC 0.0401 *    
7: p.value.ABC 0.3222      
           Eff   p.V1 p.Sig
1:   p.value.A 0.0041 *    
2:   p.value.B 0.2196      
3:   p.value.C 0.0000 *    
4:  p.value.AB 0.1478      
5:  p.value.AC 0.0594      
6:  p.value.BC 0.0397 *    
7: p.value.ABC 0.3620      
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
$BP

$Bars

$MargAB

$MargAC

$MargBC

$MargC

quartz_off_screen 
                2 
$BP

$Bars

$MargAB

$MargAC

$MargBC

$MargC

$AOV
            Names     Q      p  pBoot   Sig pBootMas  Sig2
1:            Age  8.32 0.0040 0.0067 *       0.0041 *    
2:          Sleep  1.52 0.2186 0.2254         0.2196      
3:           Time 29.35 0.0000 0.0000 *       0.0000 *    
4:      Age*Sleep  1.03 0.3108 0.3072         0.1478      
5:       Age*Time  1.45 0.2275 0.0484 *       0.0594      
6:     Sleep*Time  1.63 0.1802 0.0401 *       0.0397 *    
7: Age*Sleep*Time  0.62 0.6053 0.3222         0.3620      

$InterAB
            Contr psihat     df  test p.value EfSize.V1
1: Sleep on Young  -0.29 246.59 -1.89  0.0602      0.17
2:   Sleep on Old  -0.05 154.15 -0.28  0.7818      0.03
3: Age on Control   0.37 179.73  2.22  0.0276      0.29
4:      Age on SR   0.62 200.97  4.20  0.0000      0.45

$InterAC
             Contr psihat     df  test p.value EfSize.V1
 1:      Age on M1   0.34  98.60  2.95  0.0039      0.33
 2:      Age on M2   0.10 101.10  1.08  0.2844      0.10
 3:      Age on M3   0.12  95.97  1.12  0.2638      0.13
 4:      Age on M4   0.43  91.84  3.40  0.0010      0.33
 5: M1-M2 on Young  -0.56     NA -3.44  0.0025      0.48
 6:   M1-M2 on Old  -0.62     NA -3.84  0.0009      0.67
 7: M2-M3 on Young   0.00     NA  0.03  0.9795      0.04
 8:   M2-M3 on Old  -0.03     NA -0.39  0.6973      0.03
 9: M3-M4 on Young   0.48     NA  5.04  0.0001      0.44
10:   M3-M4 on Old   0.76     NA  5.82  0.0000      0.67

$InterBC
               Contr psihat     df  test p.value EfSize.V1
 1:      Sleep on M1  -0.04  98.60 -0.38  0.7053      0.02
 2:      Sleep on M2   0.03 101.10  0.34  0.7351      0.02
 3:      Sleep on M3   0.06  95.97  0.57  0.5716      0.06
 4:      Sleep on M4  -0.38  91.84 -3.04  0.0031      0.28
 5: M1-M2 on Control  -0.54     NA -3.38  0.0029      0.52
 6:      M1-M2 on SR  -0.58     NA -4.19  0.0004      0.56
 7: M2-M3 on Control  -0.05     NA -0.73  0.4749      0.05
 8:      M2-M3 on SR  -0.02     NA -0.28  0.7798      0.01
 9: M3-M4 on Control   0.80     NA  8.72  0.0000      0.63
10:      M3-M4 on SR   0.51     NA  5.36  0.0000      0.44

$DetallMainC
   Contr psihat  test p.value Psihat2 p.value2 EfSize.V1
1: M1-M2  -1.18 -4.21  0.0004   -1.36    0.000      0.54
2: M2-M3   0.00  0.04  0.9718   -0.05    0.544      0.03
3: M3-M4   1.32  7.06  0.0000    1.47    0.000      0.54

$DetallTrialCadaCondAB
            Contr psihat df  test p.value Psihat2 p.value2 dif.yuen df.yuen
 1:  M1-M2 on Y_C  -0.27 NA -3.82  0.0010   -0.26    0.000    -0.26      35
 2: M1-M2 on Y_SR  -0.32 NA -3.57  0.0018   -0.30    0.000    -0.30      29
 3:  M1-M2 on O_C  -0.32 NA -3.53  0.0020   -0.46    0.000    -0.46      21
 4: M1-M2 on O_SR  -0.29 NA -4.29  0.0003   -0.34    0.000    -0.34      24
 5:  M2-M3 on Y_C  -0.03 NA -0.47  0.6414   -0.05    0.264    -0.05      35
 6: M2-M3 on Y_SR   0.04 NA  1.21  0.2411    0.01    0.624     0.01      29
 7:  M2-M3 on O_C  -0.01 NA -0.31  0.7606    0.01    0.976     0.01      21
 8: M2-M3 on O_SR  -0.07 NA -1.23  0.2329   -0.02    0.628    -0.02      24
 9:  M3-M4 on Y_C   0.38 NA  5.39  0.0000    0.37    0.000     0.34      32
10: M3-M4 on Y_SR   0.19 NA  2.48  0.0216    0.21    0.000     0.21      30
11:  M3-M4 on O_C   0.49 NA  4.86  0.0001    0.59    0.000     0.59      21
12: M3-M4 on O_SR   0.31 NA  3.95  0.0007    0.30    0.000     0.29      23
    test.yuen EffSize.yuen pvaluet.yuen
 1:     -4.84         0.42       0.0000
 2:     -5.06         0.55       0.0000
 3:     -5.56         0.69       0.0000
 4:     -5.59         0.65       0.0000
 5:     -1.19         0.09       0.2437
 6:      0.31         0.03       0.7597
 7:      0.21         0.02       0.8384
 8:     -0.44         0.07       0.6627
 9:      5.13         0.53       0.0000
10:      3.51         0.36       0.0014
11:      5.96         0.76       0.0000
12:      4.65         0.58       0.0001

$DetallSimple
$DetallSimple[[1]]
$DetallSimple[[1]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 3.14 0.080   3.14  0.080  2.50 0.1159 0.0668        0.091       
2:     Sleep 0.44 0.509   0.44  0.509  0.47 0.4920 0.4674        0.518       
3: Age*Sleep 0.07 0.795   0.01  0.930  0.01 0.9290 0.8314        0.795       
   EffSize
1:    0.18
2:    0.08
3:    0.03

$DetallSimple[[1]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.06 63.51 -0.32  0.7485      0.05      0.10 0.7644
2:   Sleep on Old  -0.13 44.74 -0.59  0.5560      0.09      0.35 0.5289
3: Age on Control  -0.21 48.10 -1.03  0.3084      0.15      1.06 0.2889
4:      Age on SR  -0.29 45.58 -1.50  0.1413      0.21      2.24 0.1433
   EffSize.Boot
1:         0.04
2:         0.09
3:         0.16
4:         0.22

$DetallSimple[[1]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.06 63.51 -0.32  0.7485      0.06      0.10 0.7578
2:   Sleep on Old  -0.13 44.74 -0.59  0.5560      0.08      0.35 0.5656
3: Age on Control  -0.21 48.10 -1.03  0.3084      0.18      1.06 0.3344
4:      Age on SR  -0.29 45.58 -1.50  0.1413      0.23      2.24 0.1278
5:      YSR vs OC  -0.16 40.57 -0.81  0.4225      0.13      0.66 0.4244
   EffSize.Boot
1:         0.06
2:         0.09
3:         0.16
4:         0.22
5:         0.13


$DetallSimple[[2]]
$DetallSimple[[2]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 1.34 0.250   1.34  0.250  0.85 0.3581 0.2504        0.274       
2:     Sleep 0.12 0.734   0.12  0.734  0.03 0.8644 0.7496        0.757       
3: Age*Sleep 0.31 0.581   0.06  0.510  0.33 0.5677 0.6444        0.592       
   EffSize
1:    0.11
2:    0.02
3:    0.09

$DetallSimple[[2]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.03 63.86 -0.16  0.8742      0.04      0.03 0.8722
2:   Sleep on Old   0.13 38.86  0.60  0.5499      0.11      0.36 0.5489
3: Age on Control  -0.24 46.90 -1.09  0.2830      0.18      1.18 0.2833
4:      Age on SR  -0.09 52.73 -0.49  0.6241      0.08      0.24 0.6256
   EffSize.Boot
1:         0.04
2:         0.10
3:         0.17
4:         0.08

$DetallSimple[[2]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.03 63.86 -0.16  0.8742      0.04      0.03 0.8722
2:   Sleep on Old   0.13 38.86  0.60  0.5499      0.11      0.36 0.5744
3: Age on Control  -0.24 46.90 -1.09  0.2830      0.17      1.18 0.2922
4:      Age on SR  -0.09 52.73 -0.49  0.6241      0.08      0.24 0.5978
5:      YSR vs OC  -0.21 40.76 -1.00  0.3216      0.15      1.01 0.3367
   EffSize.Boot
1:         0.04
2:         0.11
3:         0.19
4:         0.08
5:         0.16


$DetallSimple[[3]]
$DetallSimple[[3]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot   Sig pBootMas SigMas
1:       Age 4.54 0.037   4.54  0.037  4.49 0.0357 0.0250 *        0.026  *    
2:     Sleep 0.12 0.734   0.12  0.734  1.26 0.2640 0.7379          0.739       
3: Age*Sleep 0.01 0.913   0.01  0.900  0.04 0.8353 0.8214          0.919       
   EffSize
1:    0.24
2:    0.04
3:    0.01

$DetallSimple[[3]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.06 61.84  0.41  0.6867      0.06      0.16 0.6611
2:   Sleep on Old   0.03 40.85  0.14  0.8898      0.03      0.02 0.8822
3: Age on Control  -0.26 45.95 -1.70  0.0957      0.24      2.89 0.0822
4:      Age on SR  -0.29 39.89 -1.39  0.1713      0.22      1.94 0.1600
   EffSize.Boot
1:         0.05
2:         0.04
3:         0.26
4:         0.24

$DetallSimple[[3]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.06 61.84  0.41  0.6867      0.06      0.16 0.6933
2:   Sleep on Old   0.03 40.85  0.14  0.8898      0.04      0.02 0.9144
3: Age on Control  -0.26 45.95 -1.70  0.0957      0.27      2.89 0.0656
4:      Age on SR  -0.29 39.89 -1.39  0.1713      0.23      1.94 0.1711
5:      YSR vs OC  -0.32 46.46 -2.00  0.0512      0.30      4.00 0.0311
   EffSize.Boot
1:         0.04
2:         0.04
3:         0.26
4:         0.23
5:         0.32


$DetallSimple[[4]]
$DetallSimple[[4]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot   Sig pBootMas SigMas
1:       Age 8.62 0.005   8.62  0.005 12.85 0.0004 0.0067 *        0.007  *    
2:     Sleep 0.04 0.847   0.04  0.847  0.95 0.3323 0.8364          0.843       
3: Age*Sleep 6.68 0.012  -0.22  0.010  6.57 0.0112 0.0050 *        0.009  *    
   EffSize
1:    0.34
2:    0.08
3:    0.43

$DetallSimple[[4]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.54 46.29  2.30  0.0261      0.36      5.29 0.0344
2:   Sleep on Old  -0.47 40.84 -1.50  0.1411      0.29      2.25 0.1267
3: Age on Control  -0.07 55.98 -0.25  0.8062      0.07      0.06 0.8100
4:      Age on SR  -1.08 29.79 -3.93  0.0005      0.58     15.48 0.0011
   EffSize.Boot
1:         0.36
2:         0.28
3:         0.07
4:         0.58

$DetallSimple[[4]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.54 46.29  2.30  0.0261      0.36      5.29 0.0278
2:   Sleep on Old  -0.47 40.84 -1.50  0.1411      0.29      2.25 0.1400
3: Age on Control  -0.07 55.98 -0.25  0.8062      0.07      0.06 0.8178
4:      Age on SR  -1.08 29.79 -3.93  0.0005      0.59     15.48 0.0000
5:      YSR vs OC  -0.61 32.25 -3.14  0.0036      0.46      9.88 0.0044
   EffSize.Boot
1:         0.36
2:         0.29
3:         0.06
4:         0.58
5:         0.47
Omnibus AOV. Design 2x2x(4xS)
Names Q p pBoot Sig pBootMas Sig2
Age 8.32 0.0040 0.0067
0.0041
Sleep 1.52 0.2186 0.2254 0.2196
Time 29.35 0.0000 0.0000
0.0000
Age*Sleep 1.03 0.3108 0.3072 0.1478
Age*Time 1.45 0.2275 0.0484
0.0594
Sleep*Time 1.63 0.1802 0.0401
0.0397
AgeSleepTime 0.62 0.6053 0.3222 0.3620
Interaction Age-Sleep. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1
Sleep on Young -0.29 246.59 -1.89 0.0602 0.17
Sleep on Old -0.05 154.15 -0.28 0.7818 0.03
Age on Control 0.37 179.73 2.22 0.0276 0.29
Age on SR 0.62 200.97 4.20 0.0000 0.45
Interaction Age-Time. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1
Age on M1 0.34 98.60 2.95 0.0039 0.33
Age on M2 0.10 101.10 1.08 0.2844 0.10
Age on M3 0.12 95.97 1.12 0.2638 0.13
Age on M4 0.43 91.84 3.40 0.0010 0.33
M1-M2 on Young -0.56 NA -3.44 0.0025 0.48
M1-M2 on Old -0.62 NA -3.84 0.0009 0.67
M2-M3 on Young 0.00 NA 0.03 0.9795 0.04
M2-M3 on Old -0.03 NA -0.39 0.6973 0.03
M3-M4 on Young 0.48 NA 5.04 0.0001 0.44
M3-M4 on Old 0.76 NA 5.82 0.0000 0.67
Interaction Sleep-Time. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1
Sleep on M1 -0.04 98.60 -0.38 0.7053 0.02
Sleep on M2 0.03 101.10 0.34 0.7351 0.02
Sleep on M3 0.06 95.97 0.57 0.5716 0.06
Sleep on M4 -0.38 91.84 -3.04 0.0031 0.28
M1-M2 on Control -0.54 NA -3.38 0.0029 0.52
M1-M2 on SR -0.58 NA -4.19 0.0004 0.56
M2-M3 on Control -0.05 NA -0.73 0.4749 0.05
M2-M3 on SR -0.02 NA -0.28 0.7798 0.01
M3-M4 on Control 0.80 NA 8.72 0.0000 0.63
M3-M4 on SR 0.51 NA 5.36 0.0000 0.44
Main Effect Time. Design 2x2x(4xS)
Contr psihat test p.value Psihat2 p.value2 EfSize.V1
M1-M2 -1.18 -4.21 0.0004 -1.36 0.000 0.54
M2-M3 0.00 0.04 0.9718 -0.05 0.544 0.03
M3-M4 1.32 7.06 0.0000 1.47 0.000 0.54
Simple Effect Time each Age-Sleep condition. Design 2x2x(4xS)
Contr psihat df test p.value Psihat2 p.value2 dif.yuen df.yuen test.yuen EffSize.yuen pvaluet.yuen
M1-M2 on Y_C -0.27 NA -3.82 0.0010 -0.26 0.000 -0.26 35 -4.84 0.42 0.0000
M1-M2 on Y_SR -0.32 NA -3.57 0.0018 -0.30 0.000 -0.30 29 -5.06 0.55 0.0000
M1-M2 on O_C -0.32 NA -3.53 0.0020 -0.46 0.000 -0.46 21 -5.56 0.69 0.0000
M1-M2 on O_SR -0.29 NA -4.29 0.0003 -0.34 0.000 -0.34 24 -5.59 0.65 0.0000
M2-M3 on Y_C -0.03 NA -0.47 0.6414 -0.05 0.264 -0.05 35 -1.19 0.09 0.2437
M2-M3 on Y_SR 0.04 NA 1.21 0.2411 0.01 0.624 0.01 29 0.31 0.03 0.7597
M2-M3 on O_C -0.01 NA -0.31 0.7606 0.01 0.976 0.01 21 0.21 0.02 0.8384
M2-M3 on O_SR -0.07 NA -1.23 0.2329 -0.02 0.628 -0.02 24 -0.44 0.07 0.6627
M3-M4 on Y_C 0.38 NA 5.39 0.0000 0.37 0.000 0.34 32 5.13 0.53 0.0000
M3-M4 on Y_SR 0.19 NA 2.48 0.0216 0.21 0.000 0.21 30 3.51 0.36 0.0014
M3-M4 on O_C 0.49 NA 4.86 0.0001 0.59 0.000 0.59 21 5.96 0.76 0.0000
M3-M4 on O_SR 0.31 NA 3.95 0.0007 0.30 0.000 0.29 23 4.65 0.58 0.0001
Simple Effect Age-Sleep on Time=1 Omnibus AOV. Design 2x2x(4xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 3.14 0.080 3.14 0.080 2.50 0.1159 0.0668 0.091 0.18
Sleep 0.44 0.509 0.44 0.509 0.47 0.4920 0.4674 0.518 0.08
Age*Sleep 0.07 0.795 0.01 0.930 0.01 0.9290 0.8314 0.795 0.03
Simple Effect Age-Sleep on Time=1 Simple Effects. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.06 63.51 -0.32 0.7485 0.05 0.10 0.7644 0.04
Sleep on Old -0.13 44.74 -0.59 0.5560 0.09 0.35 0.5289 0.09
Age on Control -0.21 48.10 -1.03 0.3084 0.15 1.06 0.2889 0.16
Age on SR -0.29 45.58 -1.50 0.1413 0.21 2.24 0.1433 0.22
Simple Effect Age-Sleep on Time=1 Extense Simple Effects. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.06 63.51 -0.32 0.7485 0.06 0.10 0.7578 0.06
Sleep on Old -0.13 44.74 -0.59 0.5560 0.08 0.35 0.5656 0.09
Age on Control -0.21 48.10 -1.03 0.3084 0.18 1.06 0.3344 0.16
Age on SR -0.29 45.58 -1.50 0.1413 0.23 2.24 0.1278 0.22
YSR vs OC -0.16 40.57 -0.81 0.4225 0.13 0.66 0.4244 0.13
Simple Effect Age-Sleep on Time=2 Omnibus AOV. Design 2x2x(4xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 1.34 0.250 1.34 0.250 0.85 0.3581 0.2504 0.274 0.11
Sleep 0.12 0.734 0.12 0.734 0.03 0.8644 0.7496 0.757 0.02
Age*Sleep 0.31 0.581 0.06 0.510 0.33 0.5677 0.6444 0.592 0.09
Simple Effect Age-Sleep on Time=2 Simple Effects. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.03 63.86 -0.16 0.8742 0.04 0.03 0.8722 0.04
Sleep on Old 0.13 38.86 0.60 0.5499 0.11 0.36 0.5489 0.10
Age on Control -0.24 46.90 -1.09 0.2830 0.18 1.18 0.2833 0.17
Age on SR -0.09 52.73 -0.49 0.6241 0.08 0.24 0.6256 0.08
Simple Effect Age-Sleep on Time=2 Extense Simple Effects. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.03 63.86 -0.16 0.8742 0.04 0.03 0.8722 0.04
Sleep on Old 0.13 38.86 0.60 0.5499 0.11 0.36 0.5744 0.11
Age on Control -0.24 46.90 -1.09 0.2830 0.17 1.18 0.2922 0.19
Age on SR -0.09 52.73 -0.49 0.6241 0.08 0.24 0.5978 0.08
YSR vs OC -0.21 40.76 -1.00 0.3216 0.15 1.01 0.3367 0.16
Simple Effect Age-Sleep on Time=3 Omnibus AOV. Design 2x2x(4xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 4.54 0.037 4.54 0.037 4.49 0.0357 0.0250
0.026
0.24
Sleep 0.12 0.734 0.12 0.734 1.26 0.2640 0.7379 0.739 0.04
Age*Sleep 0.01 0.913 0.01 0.900 0.04 0.8353 0.8214 0.919 0.01
Simple Effect Age-Sleep on Time=3 Simple Effects. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.06 61.84 0.41 0.6867 0.06 0.16 0.6611 0.05
Sleep on Old 0.03 40.85 0.14 0.8898 0.03 0.02 0.8822 0.04
Age on Control -0.26 45.95 -1.70 0.0957 0.24 2.89 0.0822 0.26
Age on SR -0.29 39.89 -1.39 0.1713 0.22 1.94 0.1600 0.24
Simple Effect Age-Sleep on Time=3 Extense Simple Effects. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.06 61.84 0.41 0.6867 0.06 0.16 0.6933 0.04
Sleep on Old 0.03 40.85 0.14 0.8898 0.04 0.02 0.9144 0.04
Age on Control -0.26 45.95 -1.70 0.0957 0.27 2.89 0.0656 0.26
Age on SR -0.29 39.89 -1.39 0.1713 0.23 1.94 0.1711 0.23
YSR vs OC -0.32 46.46 -2.00 0.0512 0.30 4.00 0.0311 0.32
Simple Effect Age-Sleep on Time=4 Omnibus AOV. Design 2x2x(4xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 8.62 0.005 8.62 0.005 12.85 0.0004 0.0067
0.007
0.34
Sleep 0.04 0.847 0.04 0.847 0.95 0.3323 0.8364 0.843 0.08
Age*Sleep 6.68 0.012 -0.22 0.010 6.57 0.0112 0.0050
0.009
0.43
Simple Effect Age-Sleep on Time=4 Simple Effects. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.54 46.29 2.30 0.0261 0.36 5.29 0.0344 0.36
Sleep on Old -0.47 40.84 -1.50 0.1411 0.29 2.25 0.1267 0.28
Age on Control -0.07 55.98 -0.25 0.8062 0.07 0.06 0.8100 0.07
Age on SR -1.08 29.79 -3.93 0.0005 0.58 15.48 0.0011 0.58
Simple Effect Age-Sleep on Time=4 Extense Simple Effects. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.54 46.29 2.30 0.0261 0.36 5.29 0.0278 0.36
Sleep on Old -0.47 40.84 -1.50 0.1411 0.29 2.25 0.1400 0.29
Age on Control -0.07 55.98 -0.25 0.8062 0.07 0.06 0.8178 0.06
Age on SR -1.08 29.79 -3.93 0.0005 0.59 15.48 0.0000 0.58
YSR vs OC -0.61 32.25 -3.14 0.0036 0.46 9.88 0.0044 0.47


4 Figure 3. Cell-type remapping across sessions during performance in the OPR task.


Figure 3. Cell-type remapping across sessions during performance in the OPR task. A) Schematic indicating how similarity scores were computed. B-D) Average global remapping of context (B), object configuration (C), and unstable (D) cells across trials and corresponding examples of color-coded place cell rate maps, trajectory spike maps, and waveforms. Context cells are only unstable in the old control group, suggesting that poor performance in this group stems from inability to recall the context. Conversely, object configuration cells, which by definition remap when the objects are introduced, display intermediate levels of stability in young controls and old SD, the groups that show successful performance in the OPR task. Conversely, poor OPR performance is associated with either too much object configuration stability (young SD animals) or too much object configuration instability (old controls). No differences across conditions and/or time were observed in unstable cells. Blue indicates that the animal has visited the region but the cell has not fired, vivid colors indicate high neuronal activity (as shown in the color bar at the upper right corner). Number on top of each map represents peak firing rate (Hz) used to normalize the map colors. Red dots on the trajectory maps indicate location of action potentials. Waveform similarity indicates recording stability during the 24 hr period of training and testing. Context cells: Young controls (YC=23 cells), young SD (YSD=20 cells), old control (OC=8 cells), old SD (OSD=9 cells). Object cells: Young control (YC: 15 cells), young SD (YSD: 13 cells), old control (OC: 17 cells), old SD (OSD: 14 cells). Unstable cells: Young control (YC=22 cells), young SD (YSD=17 cells), old control (OC=11 cells), old SD (OSD=18 cells). Asterisks (*) represent significance using alpha=0.05. Statistical details in Supplemental Statistical Table corresponding to Figure 3.


4.1 Fig 3B Average global remapping of context cells {Design 2x2x(4xS)}

  NmBas="Fig3B ContextCells"
  NmFAlL<-paste0(PathDesign,NmBas)
  if (!dir.exists(NmFAlL)) {dir.create(NmFAlL)}
  NmFAlL<-paste0(NmFAlL,"/")
  ResGen<-NA
    
  rrt<-ExDataIS.3(nmF = paste0(PathDesign,"Cell_types (ANOVA_Overall_correlations).csv"),Vars = ,c(3,4,12,7:10),vIntP =c(4:7),lvlCh = list("HABxT1"="s1xs2", "T1xT2"="s2xs3","T2xT3"="s3xs4","T3xTest"="s4xs5"),TypCel = "Context")
  DatDT<-rrt$DT
  ArP<-rrt$Arp
  ExtendDT<-rrt$ExtendDT
  
  # For Simple Effects:
  DatEfS<-list()
  for(is in 1:4) {
    DatEfS[[is]]<-ExData.2b(nmF = paste0(PathDesign,"Cell_types (ANOVA_Overall_correlations).csv"),Vars = c(3:4,(6+is)),TypCel = "Context")
    names(DatEfS[[is]]$DT)[3]<-"DepV"
  }

  # Graphs
  Grp<- Grph.3(DatP = ExtendDT,"OPR",LblsP =c("Cell-Type Remapping Context Cells", "","Similarity Score"),ylmP =c(-0.5,1.2),hLin = T,lvIp = 4)
  
  levBp<-seq(0.7, 5, by=0.2)
  Grp2<- Grp + geom_signif(annotation="*",
              y_position=0.95, xmin=levBp[1+15]  , xmax=levBp[3+15], 
              tip_length = c(0.02, 0.02),textsize=6) +
    geom_signif(annotation="*",
              y_position=0.8, xmin=levBp[3+15]  , xmax=levBp[4+15], 
              tip_length = c(0.02, 0.02),textsize=6)+
    geom_signif(annotation=c("","","*"),
              y_position=c(0.3,0.3,0.25),
              xmin=c(levBp[1],levBp[1+5], mean(levBp[c(1,2)])),
              xmax=c(levBp[2],levBp[2+5], mean(levBp[c(1+5,2+5)])), 
              tip_length = c(-0.02, -0.02),vjust=2,textsize=6)+
    geom_signif(annotation=c("","","*"),
              y_position=c(0.3,-0.35,-0.4),
              xmin=c(levBp[1+10], levBp[1+15], mean(levBp[c(1+10,4+10)])),
              xmax=c(levBp[4+10], levBp[4+15], mean(levBp[c(1+15,4+15)])), 
              tip_length = c(c(-0.02, -0.02),c(-0.02, -0.02),c(-.52, -0.02)),vjust=14,textsize=6)
  
  #AOV
  names(rrt$DT)[4:7]<-c("T1","T2","T3","T4")
  ResGen<-AOVMx2(A=2,B=2,C=4,DatPas = rrt,DatEfSp = DatEfS,nBMM1 = 10000,nBMM2 = 1000,Prc = 2)
  
  AlmacenGen2(GrpP = Grp,Grp2P = Grp2,DataPas = ResGen,PathDesignP = PathDesign,NmBasP = NmBas,Typ=2)
  
  # Other Graphs
    GrpO<-Grph.3.Otros(ExtendDT,LblsP =c("Cell-Type Remapping Context Cells", "B","Similarity Score"))
    
    ExtendDTCol<-copy(ExtendDT)
    ExtendDTCol$Moment<-"All"
    ExtendDTCol<-data.table(rbind(ExtendDT,ExtendDTCol))
    Grp3<-Grph.3(DatP = ExtendDTCol,"OPR",LblsP =c("Cell-Type Remapping Context Cells", "B","Similarity Score"),ylmP =c(-0.5,1.2),hLin = T,lvIp = 5,wMain = T)
   
    pdf(paste0(NmFAlL,NmBas,"OtrosGraphs.pdf"))
      Grp3
      GrpO
    dev.off()
  
        # Results
        plot(Grp)
        plot(Grp2) # Only this graph is printed in the html file.
        GrpO
        plot(Grp3)
        ResGen # Lean option to view the results of statistical analysis
        
        Kbl3(ResPas = ResGen[[1]], lbl = "Omnibus AOV. Design 2x2x(4xS)");cat("\n")
        Kbl3(ResGen[[2]], "Interaction Age-Sleep. Design 2x2x(4xS)")
        Kbl3(ResGen[[3]], "Interaction Age-Time. Design 2x2x(4xS)")
        Kbl3(ResGen[[4]], "Interaction Sleep-Time. Design 2x2x(4xS)")
        Kbl3(ResGen[[5]], "Main Effect Time. Design 2x2x(4xS)")
        Kbl3(ResGen[[6]], "Simple Effect Time each Age-Sleep condition. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[1]][[1]], "Simple Effect Age-Sleep on Time=1 Omnibus AOV. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[1]][[2]], "Simple Effect Age-Sleep on Time=1 Simple Effects. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[1]][[3]], "Simple Effect Age-Sleep on Time=1 Extense Simple Effects. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[2]][[1]], "Simple Effect Age-Sleep on Time=2 Omnibus AOV. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[2]][[2]], "Simple Effect Age-Sleep on Time=2 Simple Effects. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[2]][[3]], "Simple Effect Age-Sleep on Time=2 Extense Simple Effects. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[3]][[1]], "Simple Effect Age-Sleep on Time=3 Omnibus AOV. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[3]][[2]], "Simple Effect Age-Sleep on Time=3 Simple Effects. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[3]][[3]], "Simple Effect Age-Sleep on Time=3 Extense Simple Effects. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[4]][[1]], "Simple Effect Age-Sleep on Time=4 Omnibus AOV. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[4]][[2]], "Simple Effect Age-Sleep on Time=4 Simple Effects. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[4]][[3]], "Simple Effect Age-Sleep on Time=4 Extense Simple Effects. Design 2x2x(4xS)")
           Eff   p.V1 p.Sig
1:   p.value.A 0.0100 *    
2:   p.value.B 0.9466      
3:   p.value.C 0.0000 *    
4:  p.value.AB 0.1336      
5:  p.value.AC 0.4674      
6:  p.value.BC 0.2170      
7: p.value.ABC 0.0651      
           Eff   p.V1 p.Sig
1:   p.value.A 0.0062 *    
2:   p.value.B 0.9472      
3:   p.value.C 0.0000 *    
4:  p.value.AB 0.0004 *    
5:  p.value.AC 0.4694      
6:  p.value.BC 0.2296      
7: p.value.ABC 0.0484 *    
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
$BP

$Bars

$MargAB

$MargAC

$MargBC

$MargC

quartz_off_screen 
                2 
$BP

$Bars

$MargAB

$MargAC

$MargBC

$MargC

$AOV
            Names    Q      p  pBoot   Sig pBootMas  Sig2
1:            Age 7.87 0.0051 0.0100 *       0.0062 *    
2:          Sleep 0.00 0.9475 0.9466         0.9472      
3:           Time 3.04 0.0282 0.0000 *       0.0000 *    
4:      Age*Sleep 2.18 0.1404 0.1336         0.0004 *    
5:       Age*Time 0.25 0.8643 0.4674         0.4694      
6:     Sleep*Time 0.43 0.7319 0.2170         0.2296      
7: Age*Sleep*Time 0.82 0.4844 0.0651         0.0484 *    

$InterAB
            Contr psihat    df  test p.value EfSize.V1
1: Sleep on Young   0.23 58.26  1.54  0.1297      0.27
2:   Sleep on Old  -0.24 21.91 -1.13  0.2725      0.29
3: Age on Control   0.67 19.96  3.33  0.0033      0.60
4:      Age on SR   0.20 45.73  1.26  0.2127      0.23

$InterAC
             Contr psihat    df  test p.value EfSize.V1
 1:      Age on M1   0.17 22.70  1.70  0.1036      0.31
 2:      Age on M2   0.15 18.57  1.48  0.1560      0.30
 3:      Age on M3   0.08 18.71  0.82  0.4220      0.18
 4:      Age on M4   0.46 15.18  2.49  0.0250      0.35
 5: M1-M2 on Young  -0.29    NA -3.46  0.0181      0.38
 6:   M1-M2 on Old  -0.19    NA -1.84  0.1257      0.38
 7: M2-M3 on Young   0.07    NA  0.62  0.5654      0.14
 8:   M2-M3 on Old  -0.09    NA -0.81  0.4570      0.25
 9: M3-M4 on Young   0.50    NA  3.32  0.0210      0.62
10:   M3-M4 on Old   0.88    NA  3.63  0.0151      0.94

$InterBC
               Contr psihat    df  test p.value EfSize.V1
 1:      Sleep on M1   0.16 22.70  1.57  0.1309      0.21
 2:      Sleep on M2   0.09 18.57  0.83  0.4162      0.12
 3:      Sleep on M3   0.07 18.71  0.65  0.5267      0.20
 4:      Sleep on M4  -0.32 15.18 -1.70  0.1101      0.07
 5: M1-M2 on Control  -0.15    NA -1.32  0.2437      0.31
 6:      M1-M2 on SR  -0.31    NA -2.74  0.0407      0.47
 7: M2-M3 on Control  -0.07    NA -0.52  0.6262      0.22
 8:      M2-M3 on SR   0.01    NA  0.08  0.9385      0.10
 9: M3-M4 on Control   0.70    NA  3.07  0.0279      0.76
10:      M3-M4 on SR   0.69    NA  4.06  0.0097      0.67

$DetallMainC
   Contr psihat  test p.value Psihat2 p.value2 EfSize.V1
1: M1-M2  -0.46 -5.71  0.0023   -0.40     0.00      0.38
2: M2-M3  -0.05 -0.27  0.7977   -0.19     0.12      0.16
3: M3-M4   1.36  5.05  0.0039    1.32     0.00      0.69

$DetallTrialCadaCondAB
            Contr psihat df  test p.value Psihat2 p.value2 dif.yuen df.yuen
 1:  M1-M2 on Y_C  -0.09 NA -1.19  0.2875   -0.09    0.000    -0.09      13
 2: M1-M2 on Y_SR  -0.18 NA -3.17  0.0247   -0.11    0.020    -0.11      11
 3:  M1-M2 on O_C  -0.02 NA -0.27  0.7998   -0.08    0.416    -0.08       5
 4: M1-M2 on O_SR  -0.13 NA -1.86  0.1226   -0.13    0.092    -0.13       6
 5:  M2-M3 on Y_C  -0.04 NA -0.65  0.5461   -0.06    0.112    -0.06      13
 6: M2-M3 on Y_SR   0.07 NA  1.60  0.1697   -0.01    0.896    -0.01      11
 7:  M2-M3 on O_C  -0.01 NA -0.14  0.8973   -0.03    0.652    -0.03       5
 8: M2-M3 on O_SR  -0.08 NA -1.52  0.1883   -0.10    0.096    -0.10       6
 9:  M3-M4 on Y_C   0.10 NA  1.53  0.1855    0.21    0.000     0.20      10
10: M3-M4 on Y_SR   0.40 NA  3.66  0.0146    0.26    0.000     0.26      11
11:  M3-M4 on O_C   0.58 NA  2.28  0.0712    0.64    0.000     0.64       5
12: M3-M4 on O_SR   0.27 NA  2.12  0.0879    0.21    0.008     0.21       6
    test.yuen EffSize.yuen pvaluet.yuen
 1:     -2.20         0.29       0.0461
 2:     -2.26         0.53       0.0451
 3:     -1.07         0.34       0.3346
 4:     -1.92         0.41       0.1033
 5:     -1.43         0.23       0.1774
 6:     -0.11         0.02       0.9106
 7:     -0.38         0.12       0.7226
 8:     -1.84         0.35       0.1155
 9:      4.00         0.57       0.0025
10:      3.21         0.61       0.0082
11:      3.77         0.96       0.0131
12:      2.52         0.77       0.0451

$DetallSimple
$DetallSimple[[1]]
$DetallSimple[[1]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 2.88 0.103   2.88  0.103  1.78 0.1931 0.1018        0.105       
2:     Sleep 2.46 0.131   2.46  0.131  1.94 0.1748 0.1319        0.144       
3: Age*Sleep 0.75 0.397   0.11  0.540  0.58 0.4546 0.4290        0.410       
   EffSize
1:    0.29
2:    0.21
3:    0.24

$DetallSimple[[1]]$Detall
            Contr psihat    df test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.04 23.26 0.52  0.6107      0.14      0.27 0.6222
2:   Sleep on Old   0.12  8.26 1.66  0.1343      0.42      2.76 0.1244
3: Age on Control   0.04 12.47 0.50  0.6255      0.20      0.25 0.6311
4:      Age on SR   0.13 16.36 2.30  0.0350      0.44      5.28 0.0411
   EffSize.Boot
1:         0.13
2:         0.42
3:         0.15
4:         0.47

$DetallSimple[[1]]$DetallExt
            Contr psihat    df test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.04 23.26 0.52  0.6107      0.13      0.27 0.6100
2:   Sleep on Old   0.12  8.26 1.66  0.1343      0.42      2.76 0.1367
3: Age on Control   0.04 12.47 0.50  0.6255      0.14      0.25 0.6278
4:      Age on SR   0.13 16.36 2.30  0.0350      0.44      5.28 0.0411
5:      YSR vs OC   0.01  9.44 0.09  0.9339      0.13      0.01 0.9211
   EffSize.Boot
1:         0.13
2:         0.42
3:         0.15
4:         0.45
5:         0.11


$DetallSimple[[2]]
$DetallSimple[[2]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 2.19 0.156   2.19  0.156  1.79 0.1933 0.1619        0.160       
2:     Sleep 0.69 0.416   0.69  0.416  0.10 0.7561 0.4073        0.396       
3: Age*Sleep 0.29 0.598   0.10  0.590  0.10 0.7489 0.6811        0.599       
   EffSize
1:    0.28
2:    0.11
3:    0.18

$DetallSimple[[2]]$Detall
            Contr psihat    df test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.02 20.25 0.29  0.7777      0.10      0.08 0.7989
2:   Sleep on Old   0.07 10.73 0.80  0.4421      0.20      0.64 0.4422
3: Age on Control   0.05  8.30 0.78  0.4566      0.20      0.61 0.4622
4:      Age on SR   0.10 10.68 1.26  0.2334      0.35      1.60 0.2211
   EffSize.Boot
1:         0.08
2:         0.20
3:         0.24
4:         0.33

$DetallSimple[[2]]$DetallExt
            Contr psihat    df test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.02 20.25 0.29  0.7777      0.09      0.08 0.7911
2:   Sleep on Old   0.07 10.73 0.80  0.4421      0.25      0.64 0.4389
3: Age on Control   0.05  8.30 0.78  0.4566      0.24      0.61 0.4661
4:      Age on SR   0.10 10.68 1.26  0.2334      0.33      1.60 0.2278
5:      YSR vs OC   0.03 11.36 0.48  0.6405      0.28      0.23 0.6778
   EffSize.Boot
1:         0.09
2:         0.20
3:         0.17
4:         0.34
5:         0.23


$DetallSimple[[3]]
$DetallSimple[[3]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 0.67 0.422   0.67  0.422  0.75 0.3933 0.4508        0.428       
2:     Sleep 0.42 0.527   0.42  0.527  0.23 0.6367 0.5376        0.561       
3: Age*Sleep 0.46 0.507  -0.11  0.560  0.95 0.3380 0.6661        0.507       
   EffSize
1:    0.16
2:    0.21
3:    0.23

$DetallSimple[[3]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.07 23.60  1.22  0.2355      0.27      1.48 0.2378
2:   Sleep on Old   0.00  9.99 -0.02  0.9853      0.08      0.00 0.9844
3: Age on Control   0.08  9.38  0.96  0.3620      0.23      0.92 0.3675
4:      Age on SR   0.01 11.09  0.12  0.9101      0.13      0.01 0.9111
   EffSize.Boot
1:         0.25
2:         0.08
3:         0.29
4:         0.15

$DetallSimple[[3]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.07 23.60  1.22  0.2355      0.27      1.48 0.2622
2:   Sleep on Old   0.00  9.99 -0.02  0.9853      0.08      0.00 0.9833
3: Age on Control   0.08  9.38  0.96  0.3620      0.25      0.92 0.3900
4:      Age on SR   0.01 11.09  0.12  0.9101      0.16      0.01 0.9044
5:      YSR vs OC   0.01  7.79  0.12  0.9085      0.17      0.01 0.9200
   EffSize.Boot
1:         0.26
2:         0.04
3:         0.24
4:         0.16
5:         0.13


$DetallSimple[[4]]
$DetallSimple[[4]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1 pBoot Sig pBootMas SigMas
1:       Age 6.19 0.024   6.19  0.024  7.97 0.0080    NA            1       
2:     Sleep 2.88 0.109   2.88  0.109  0.23 0.6333    NA            0  *    
3: Age*Sleep 8.35 0.010  -0.38  0.020  8.53 0.0063    NA            0  *    
   EffSize
1:    0.35
2:    0.08
3:    0.62

$DetallSimple[[4]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.11 20.06  1.03  0.3167      0.22      1.05 0.3011
2:   Sleep on Old  -0.43  7.30 -2.82  0.0248      0.61      7.93 0.0300
3: Age on Control   0.50  7.38  3.31  0.0120      0.65     10.94 0.0289
4:      Age on SR  -0.04 16.97 -0.35  0.7343      0.17      0.12 0.7389
   EffSize.Boot
1:         0.24
2:         0.61
3:         0.65
4:         0.14

$DetallSimple[[4]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.11 20.06  1.03  0.3167      0.23      1.05 0.3311
2:   Sleep on Old  -0.43  7.30 -2.82  0.0248      0.61      7.93 0.0389
3: Age on Control   0.50  7.38  3.31  0.0120      0.65     10.94 0.0122
4:      Age on SR  -0.04 16.97 -0.35  0.7343      0.17      0.12 0.7411
5:      YSR vs OC   0.39  9.11  2.42  0.0385      0.64      5.84 0.0467
   EffSize.Boot
1:         0.24
2:         0.61
3:         0.66
4:         0.19
5:         0.65
Omnibus AOV. Design 2x2x(4xS)
Names Q p pBoot Sig pBootMas Sig2
Age 7.87 0.0051 0.0100
0.0062
Sleep 0.00 0.9475 0.9466 0.9472
Time 3.04 0.0282 0.0000
0.0000
Age*Sleep 2.18 0.1404 0.1336 0.0004
Age*Time 0.25 0.8643 0.4674 0.4694
Sleep*Time 0.43 0.7319 0.2170 0.2296
AgeSleepTime 0.82 0.4844 0.0651 0.0484
Interaction Age-Sleep. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1
Sleep on Young 0.23 58.26 1.54 0.1297 0.27
Sleep on Old -0.24 21.91 -1.13 0.2725 0.29
Age on Control 0.67 19.96 3.33 0.0033 0.60
Age on SR 0.20 45.73 1.26 0.2127 0.23
Interaction Age-Time. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1
Age on M1 0.17 22.70 1.70 0.1036 0.31
Age on M2 0.15 18.57 1.48 0.1560 0.30
Age on M3 0.08 18.71 0.82 0.4220 0.18
Age on M4 0.46 15.18 2.49 0.0250 0.35
M1-M2 on Young -0.29 NA -3.46 0.0181 0.38
M1-M2 on Old -0.19 NA -1.84 0.1257 0.38
M2-M3 on Young 0.07 NA 0.62 0.5654 0.14
M2-M3 on Old -0.09 NA -0.81 0.4570 0.25
M3-M4 on Young 0.50 NA 3.32 0.0210 0.62
M3-M4 on Old 0.88 NA 3.63 0.0151 0.94
Interaction Sleep-Time. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1
Sleep on M1 0.16 22.70 1.57 0.1309 0.21
Sleep on M2 0.09 18.57 0.83 0.4162 0.12
Sleep on M3 0.07 18.71 0.65 0.5267 0.20
Sleep on M4 -0.32 15.18 -1.70 0.1101 0.07
M1-M2 on Control -0.15 NA -1.32 0.2437 0.31
M1-M2 on SR -0.31 NA -2.74 0.0407 0.47
M2-M3 on Control -0.07 NA -0.52 0.6262 0.22
M2-M3 on SR 0.01 NA 0.08 0.9385 0.10
M3-M4 on Control 0.70 NA 3.07 0.0279 0.76
M3-M4 on SR 0.69 NA 4.06 0.0097 0.67
Main Effect Time. Design 2x2x(4xS)
Contr psihat test p.value Psihat2 p.value2 EfSize.V1
M1-M2 -0.46 -5.71 0.0023 -0.40 0.00 0.38
M2-M3 -0.05 -0.27 0.7977 -0.19 0.12 0.16
M3-M4 1.36 5.05 0.0039 1.32 0.00 0.69
Simple Effect Time each Age-Sleep condition. Design 2x2x(4xS)
Contr psihat df test p.value Psihat2 p.value2 dif.yuen df.yuen test.yuen EffSize.yuen pvaluet.yuen
M1-M2 on Y_C -0.09 NA -1.19 0.2875 -0.09 0.000 -0.09 13 -2.20 0.29 0.0461
M1-M2 on Y_SR -0.18 NA -3.17 0.0247 -0.11 0.020 -0.11 11 -2.26 0.53 0.0451
M1-M2 on O_C -0.02 NA -0.27 0.7998 -0.08 0.416 -0.08 5 -1.07 0.34 0.3346
M1-M2 on O_SR -0.13 NA -1.86 0.1226 -0.13 0.092 -0.13 6 -1.92 0.41 0.1033
M2-M3 on Y_C -0.04 NA -0.65 0.5461 -0.06 0.112 -0.06 13 -1.43 0.23 0.1774
M2-M3 on Y_SR 0.07 NA 1.60 0.1697 -0.01 0.896 -0.01 11 -0.11 0.02 0.9106
M2-M3 on O_C -0.01 NA -0.14 0.8973 -0.03 0.652 -0.03 5 -0.38 0.12 0.7226
M2-M3 on O_SR -0.08 NA -1.52 0.1883 -0.10 0.096 -0.10 6 -1.84 0.35 0.1155
M3-M4 on Y_C 0.10 NA 1.53 0.1855 0.21 0.000 0.20 10 4.00 0.57 0.0025
M3-M4 on Y_SR 0.40 NA 3.66 0.0146 0.26 0.000 0.26 11 3.21 0.61 0.0082
M3-M4 on O_C 0.58 NA 2.28 0.0712 0.64 0.000 0.64 5 3.77 0.96 0.0131
M3-M4 on O_SR 0.27 NA 2.12 0.0879 0.21 0.008 0.21 6 2.52 0.77 0.0451
Simple Effect Age-Sleep on Time=1 Omnibus AOV. Design 2x2x(4xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 2.88 0.103 2.88 0.103 1.78 0.1931 0.1018 0.105 0.29
Sleep 2.46 0.131 2.46 0.131 1.94 0.1748 0.1319 0.144 0.21
Age*Sleep 0.75 0.397 0.11 0.540 0.58 0.4546 0.4290 0.410 0.24
Simple Effect Age-Sleep on Time=1 Simple Effects. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.04 23.26 0.52 0.6107 0.14 0.27 0.6222 0.13
Sleep on Old 0.12 8.26 1.66 0.1343 0.42 2.76 0.1244 0.42
Age on Control 0.04 12.47 0.50 0.6255 0.20 0.25 0.6311 0.15
Age on SR 0.13 16.36 2.30 0.0350 0.44 5.28 0.0411 0.47
Simple Effect Age-Sleep on Time=1 Extense Simple Effects. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.04 23.26 0.52 0.6107 0.13 0.27 0.6100 0.13
Sleep on Old 0.12 8.26 1.66 0.1343 0.42 2.76 0.1367 0.42
Age on Control 0.04 12.47 0.50 0.6255 0.14 0.25 0.6278 0.15
Age on SR 0.13 16.36 2.30 0.0350 0.44 5.28 0.0411 0.45
YSR vs OC 0.01 9.44 0.09 0.9339 0.13 0.01 0.9211 0.11
Simple Effect Age-Sleep on Time=2 Omnibus AOV. Design 2x2x(4xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 2.19 0.156 2.19 0.156 1.79 0.1933 0.1619 0.160 0.28
Sleep 0.69 0.416 0.69 0.416 0.10 0.7561 0.4073 0.396 0.11
Age*Sleep 0.29 0.598 0.10 0.590 0.10 0.7489 0.6811 0.599 0.18
Simple Effect Age-Sleep on Time=2 Simple Effects. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.02 20.25 0.29 0.7777 0.10 0.08 0.7989 0.08
Sleep on Old 0.07 10.73 0.80 0.4421 0.20 0.64 0.4422 0.20
Age on Control 0.05 8.30 0.78 0.4566 0.20 0.61 0.4622 0.24
Age on SR 0.10 10.68 1.26 0.2334 0.35 1.60 0.2211 0.33
Simple Effect Age-Sleep on Time=2 Extense Simple Effects. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.02 20.25 0.29 0.7777 0.09 0.08 0.7911 0.09
Sleep on Old 0.07 10.73 0.80 0.4421 0.25 0.64 0.4389 0.20
Age on Control 0.05 8.30 0.78 0.4566 0.24 0.61 0.4661 0.17
Age on SR 0.10 10.68 1.26 0.2334 0.33 1.60 0.2278 0.34
YSR vs OC 0.03 11.36 0.48 0.6405 0.28 0.23 0.6778 0.23
Simple Effect Age-Sleep on Time=3 Omnibus AOV. Design 2x2x(4xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.67 0.422 0.67 0.422 0.75 0.3933 0.4508 0.428 0.16
Sleep 0.42 0.527 0.42 0.527 0.23 0.6367 0.5376 0.561 0.21
Age*Sleep 0.46 0.507 -0.11 0.560 0.95 0.3380 0.6661 0.507 0.23
Simple Effect Age-Sleep on Time=3 Simple Effects. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.07 23.60 1.22 0.2355 0.27 1.48 0.2378 0.25
Sleep on Old 0.00 9.99 -0.02 0.9853 0.08 0.00 0.9844 0.08
Age on Control 0.08 9.38 0.96 0.3620 0.23 0.92 0.3675 0.29
Age on SR 0.01 11.09 0.12 0.9101 0.13 0.01 0.9111 0.15
Simple Effect Age-Sleep on Time=3 Extense Simple Effects. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.07 23.60 1.22 0.2355 0.27 1.48 0.2622 0.26
Sleep on Old 0.00 9.99 -0.02 0.9853 0.08 0.00 0.9833 0.04
Age on Control 0.08 9.38 0.96 0.3620 0.25 0.92 0.3900 0.24
Age on SR 0.01 11.09 0.12 0.9101 0.16 0.01 0.9044 0.16
YSR vs OC 0.01 7.79 0.12 0.9085 0.17 0.01 0.9200 0.13
Simple Effect Age-Sleep on Time=4 Omnibus AOV. Design 2x2x(4xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 6.19 0.024 6.19 0.024 7.97 0.0080 NA 1 0.35
Sleep 2.88 0.109 2.88 0.109 0.23 0.6333 NA 0
0.08
Age*Sleep 8.35 0.010 -0.38 0.020 8.53 0.0063 NA 0
0.62
Simple Effect Age-Sleep on Time=4 Simple Effects. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.11 20.06 1.03 0.3167 0.22 1.05 0.3011 0.24
Sleep on Old -0.43 7.30 -2.82 0.0248 0.61 7.93 0.0300 0.61
Age on Control 0.50 7.38 3.31 0.0120 0.65 10.94 0.0289 0.65
Age on SR -0.04 16.97 -0.35 0.7343 0.17 0.12 0.7389 0.14
Simple Effect Age-Sleep on Time=4 Extense Simple Effects. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.11 20.06 1.03 0.3167 0.23 1.05 0.3311 0.24
Sleep on Old -0.43 7.30 -2.82 0.0248 0.61 7.93 0.0389 0.61
Age on Control 0.50 7.38 3.31 0.0120 0.65 10.94 0.0122 0.66
Age on SR -0.04 16.97 -0.35 0.7343 0.17 0.12 0.7411 0.19
YSR vs OC 0.39 9.11 2.42 0.0385 0.64 5.84 0.0467 0.65

4.2 Fig 3C Average global remapping of object configuration cells {Design 2x2x(4xS)}

  NmBas="Fig3C ObjectCells"
  NmFAlL<-paste0(PathDesign,NmBas)
  if (!dir.exists(NmFAlL)) {dir.create(NmFAlL)}
  NmFAlL<-paste0(NmFAlL,"/")
  ResGen<-NA
  
  rrt<-ExDataIS.3(nmF = paste0(PathDesign,"Cell_types (ANOVA_Overall_correlations).csv"),Vars = ,c(3,4,12,7:10),vIntP =c(4:7),lvlCh = list("HABxT1"="s1xs2", "T1xT2"="s2xs3","T2xT3"="s3xs4","T3xTest"="s4xs5"),TypCel = "Object")
  DatDT<-rrt$DT
  ArP<-rrt$Arp
  ExtendDT<-rrt$ExtendDT
  
  # For  Simple Effects:
  DatEfS<-list()
  for(is in 1:4) {
    DatEfS[[is]]<-ExData.2b(nmF = paste0(PathDesign,"Cell_types (ANOVA_Overall_correlations).csv"),Vars = c(3:4,(6+is)),TypCel = "Object")
    names(DatEfS[[is]]$DT)[3]<-"DepV"
  }

  #Graphs
  Grp<- Grph.3(DatP = ExtendDT,"OPR",LblsP =c("Cell-Type Remapping Object Cells", "","Similarity Score"),ylmP =c(-0.5,1.2),hLin = T,lvIp = 4)
  
  levBp<-seq(0.7, 5, by=0.2)
  Grp2<- Grp + geom_signif(annotation="#",
              y_position=0.95, xmin=levBp[1+15]  , xmax=levBp[2+15], 
              tip_length = c(0.02, 0.02),textsize=6) +
    geom_signif(annotation="*",
              y_position=0.9, xmin=levBp[2+15]  , xmax=levBp[4+15], 
              tip_length = c(0.02, 0.02),textsize=6)+
    geom_signif(annotation=c("","","*"),
              y_position=c(-0.45,0.30,-0.5),
              xmin=c(levBp[1],levBp[1+5], mean(levBp[c(1,4)])),
              xmax=c(levBp[4],levBp[4+5], mean(levBp[c(1+5,4+5)])), 
              tip_length = c(c(-0.02, -0.02),c(-0.02, -0.02),c(-0.02,-.52)),vjust=15.5,textsize=6)+
    geom_signif(annotation=c("","","*"),
              y_position=c(0.3,-0.45,-0.5),
              xmin=c(levBp[1+10], levBp[1+15], mean(levBp[c(1+10,4+10)])),
              xmax=c(levBp[4+10], levBp[4+15], mean(levBp[c(1+15,4+15)])), 
              tip_length = c(c(-0.02, -0.02),c(-0.02, -0.02),c(-.52, -0.02)),vjust=15.5,textsize=6)
  
  #AOV
  names(rrt$DT)[4:7]<-c("T1","T2","T3","T4")
  ResGen<-AOVMx2(A=2,B=2,C=4,DatPas = rrt,DatEfSp = DatEfS,nBMM1 = 10000,nBMM2 = 1000,Prc = 2)
  AlmacenGen2(GrpP = Grp,Grp2P = Grp2,DataPas = ResGen,PathDesignP = PathDesign,NmBasP = NmBas,Typ=2)
  
  # Other Graphs
    GrpO<-Grph.3.Otros(ExtendDT,LblsP =c("Cell-Type Remapping Object Cells", "C","Similarity Score"))

    ExtendDTCol<-copy(ExtendDT)
    ExtendDTCol$Moment<-"All"
    ExtendDTCol<-data.table(rbind(ExtendDT,ExtendDTCol))
    Grp3<-Grph.3(DatP = ExtendDTCol,"OPR",LblsP =c("Cell-Type Remapping Object Cells", "C","Similarity Score"),ylmP =c(-0.5,1.2),hLin = T,lvIp = 5,wMain = T)
   
    pdf(paste0(NmFAlL,NmBas,"OtrosGraphs.pdf"))
      Grp3
      GrpO
    dev.off()
    
        # Results
        plot(Grp)
        plot(Grp2) # Only this graph is printed in the html file.
        GrpO
        plot(Grp3)
        ResGen # Lean option to view the results of statistical analysis
        
        Kbl3(ResPas = ResGen[[1]], lbl = "Omnibus AOV. Design 2x2x(4xS)");cat("\n")
        Kbl3(ResGen[[2]], "Interaction Age-Sleep. Design 2x2x(4xS)")
        Kbl3(ResGen[[3]], "Interaction Age-Time. Design 2x2x(4xS)")
        Kbl3(ResGen[[4]], "Interaction Sleep-Time. Design 2x2x(4xS)")
        Kbl3(ResGen[[5]], "Main Effect Time. Design 2x2x(4xS)")
        Kbl3(ResGen[[6]], "Simple Effect Time each Age-Sleep condition. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[1]][[1]], "Simple Effect Age-Sleep on Time=1 Omnibus AOV. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[1]][[2]], "Simple Effect Age-Sleep on Time=1 Simple Effects. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[1]][[3]], "Simple Effect Age-Sleep on Time=1 Extense Simple Effects. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[2]][[1]], "Simple Effect Age-Sleep on Time=2 Omnibus AOV. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[2]][[2]], "Simple Effect Age-Sleep on Time=2 Simple Effects. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[2]][[3]], "Simple Effect Age-Sleep on Time=2 Extense Simple Effects. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[3]][[1]], "Simple Effect Age-Sleep on Time=3 Omnibus AOV. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[3]][[2]], "Simple Effect Age-Sleep on Time=3 Simple Effects. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[3]][[3]], "Simple Effect Age-Sleep on Time=3 Extense Simple Effects. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[4]][[1]], "Simple Effect Age-Sleep on Time=4 Omnibus AOV. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[4]][[2]], "Simple Effect Age-Sleep on Time=4 Simple Effects. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[4]][[3]], "Simple Effect Age-Sleep on Time=4 Extense Simple Effects. Design 2x2x(4xS)")
           Eff   p.V1 p.Sig
1:   p.value.A 0.0000 *    
2:   p.value.B 0.2805      
3:   p.value.C 0.0000 *    
4:  p.value.AB 0.0584      
5:  p.value.AC 0.3873      
6:  p.value.BC 0.0851      
7: p.value.ABC 0.7279      
           Eff   p.V1 p.Sig
1:   p.value.A 0.0001 *    
2:   p.value.B 0.2828      
3:   p.value.C 0.0000 *    
4:  p.value.AB 0.0000 *    
5:  p.value.AC 0.3686      
6:  p.value.BC 0.0589      
7: p.value.ABC 0.7226      
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
$BP

$Bars

$MargAB

$MargAC

$MargBC

$MargC

quartz_off_screen 
                2 
$BP

$Bars

$MargAB

$MargAC

$MargBC

$MargC

$AOV
            Names     Q      p  pBoot   Sig pBootMas  Sig2
1:            Age 18.71 0.0000 0.0000 *       0.0001 *    
2:          Sleep  1.13 0.2882 0.2805         0.2828      
3:           Time 24.30 0.0000 0.0000 *       0.0000 *    
4:      Age*Sleep  3.88 0.0490 0.0584         0.0000 *    
5:       Age*Time  0.27 0.8505 0.3873         0.3686      
6:     Sleep*Time  0.68 0.5619 0.0851         0.0589      
7: Age*Sleep*Time  0.11 0.9554 0.7279         0.7226      

$InterAB
            Contr psihat    df  test p.value EfSize.V1
1: Sleep on Young  -0.33 50.19 -1.87  0.0675      0.53
2:   Sleep on Old   0.07 37.17  0.38  0.7094      0.13
3: Age on Control   0.26 42.90  1.25  0.2189      0.55
4:      Age on SR   0.66 59.48  4.34  0.0001      0.75

$InterAC
             Contr psihat    df   test p.value EfSize.V1
 1:      Age on M1   0.28 33.62   2.46  0.0191      0.45
 2:      Age on M2   0.10 25.30   1.05  0.3051      0.16
 3:      Age on M3   0.09 29.90   0.86  0.3957      0.13
 4:      Age on M4   0.44 26.91   2.46  0.0204      0.40
 5: M1-M2 on Young  -1.21    NA  -7.28  0.0001      0.92
 6:   M1-M2 on Old  -1.36    NA -14.01  0.0000      0.95
 7: M2-M3 on Young  -0.01    NA  -0.25  0.8086      0.00
 8:   M2-M3 on Old   0.07    NA   0.68  0.5184      0.01
 9: M3-M4 on Young   0.73    NA   6.60  0.0002      0.79
10:   M3-M4 on Old   0.96    NA   4.68  0.0016      0.90

$InterBC
               Contr psihat    df  test p.value EfSize.V1
 1:      Sleep on M1   0.05 33.62  0.41  0.6809      0.07
 2:      Sleep on M2   0.13 25.30  1.41  0.1694      0.29
 3:      Sleep on M3   0.05 29.90  0.44  0.6608      0.07
 4:      Sleep on M4  -0.49 26.91 -2.71  0.0116      0.49
 5: M1-M2 on Control  -1.31    NA -7.97  0.0000      0.97
 6:      M1-M2 on SR  -1.34    NA -8.59  0.0000      0.94
 7: M2-M3 on Control   0.11    NA  1.15  0.2846      0.09
 8:      M2-M3 on SR   0.00    NA  0.01  0.9891      0.10
 9: M3-M4 on Control   1.07    NA  6.88  0.0001      0.86
10:      M3-M4 on SR   0.62    NA  3.76  0.0056      0.73

$DetallMainC
   Contr psihat   test p.value Psihat2 p.value2 EfSize.V1
1: M1-M2  -2.61 -12.52  0.0000   -2.47     0.00      0.99
2: M2-M3   0.15   1.38  0.2053   -0.01     0.86      0.00
3: M3-M4   1.67   7.31  0.0001    1.72     0.00      0.87

$DetallTrialCadaCondAB
            Contr psihat df  test p.value Psihat2 p.value2 dif.yuen df.yuen
 1:  M1-M2 on Y_C  -0.55 NA -5.02  0.0010   -0.56    0.000    -0.56       8
 2: M1-M2 on Y_SR  -0.64 NA -8.81  0.0000   -0.59    0.000    -0.59       8
 3:  M1-M2 on O_C  -0.77 NA -8.21  0.0000   -0.72    0.000    -0.72      10
 4: M1-M2 on O_SR  -0.62 NA -7.76  0.0001   -0.61    0.000    -0.61       9
 5:  M2-M3 on Y_C   0.04 NA  0.70  0.5024    0.03    0.632     0.03       8
 6: M2-M3 on Y_SR  -0.01 NA -0.17  0.8660   -0.03    0.656    -0.03       8
 7:  M2-M3 on O_C   0.05 NA  0.92  0.3861    0.01    0.660     0.01      10
 8: M2-M3 on O_SR   0.00 NA  0.00  0.9973   -0.02    0.792    -0.02       9
 9:  M3-M4 on Y_C   0.49 NA  4.91  0.0012    0.47    0.000     0.47       8
10: M3-M4 on Y_SR   0.26 NA  2.30  0.0508    0.21    0.012     0.22       9
11:  M3-M4 on O_C   0.56 NA  3.06  0.0156    0.66    0.000     0.66      10
12: M3-M4 on O_SR   0.40 NA  3.39  0.0095    0.38    0.004     0.36       8
    test.yuen EffSize.yuen pvaluet.yuen
 1:     -5.98         0.90       0.0003
 2:     -7.82         0.94       0.0001
 3:    -10.34         0.93       0.0000
 4:     -8.27         0.90       0.0000
 5:      0.45         0.08       0.6667
 6:     -0.57         0.12       0.5825
 7:      0.25         0.04       0.8099
 8:     -0.28         0.08       0.7884
 9:      4.63         0.93       0.0017
10:      3.17         0.66       0.0113
11:      4.56         0.84       0.0010
12:      4.93         0.92       0.0012

$DetallSimple
$DetallSimple[[1]]
$DetallSimple[[1]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot   Sig pBootMas SigMas
1:       Age 6.06 0.019   6.06  0.019  6.74 0.0121 0.0167 *        0.026  *    
2:     Sleep 0.17 0.681   0.17  0.681  0.43 0.5160 0.6745          0.710       
3: Age*Sleep 0.02 0.897  -0.10  0.510  0.22 0.6443 0.8114          0.891       
   EffSize
1:    0.44
2:    0.07
3:    0.08

$DetallSimple[[1]]$Detall
            Contr psihat    df test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.03 15.91 0.39  0.6989      0.12      0.16 0.6967
2:   Sleep on Old   0.02 17.73 0.20  0.8463      0.05      0.04 0.8311
3: Age on Control   0.15 17.08 1.91  0.0736      0.48      3.63 0.0811
4:      Age on SR   0.13 16.78 1.59  0.1306      0.35      2.53 0.1367
   EffSize.Boot
1:         0.12
2:         0.06
3:         0.47
4:         0.33

$DetallSimple[[1]]$DetallExt
            Contr psihat    df test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.03 15.91 0.39  0.6989      0.12      0.16 0.7056
2:   Sleep on Old   0.02 17.73 0.20  0.8463      0.06      0.04 0.8278
3: Age on Control   0.15 17.08 1.91  0.0736      0.46      3.63 0.0867
4:      Age on SR   0.13 16.78 1.59  0.1306      0.33      2.53 0.1244
5:      YSR vs OC   0.12 17.58 1.57  0.1345      0.37      2.46 0.1144
   EffSize.Boot
1:         0.12
2:         0.05
3:         0.46
4:         0.33
5:         0.37


$DetallSimple[[2]]
$DetallSimple[[2]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 1.10 0.305   1.10  0.305  0.76 0.3875 0.3356        0.309       
2:     Sleep 2.00 0.169   2.00  0.169  2.10 0.1529 0.1970        0.176       
3: Age*Sleep 1.86 0.185   0.18  0.230  1.58 0.2138 0.2387        0.164       
   EffSize
1:    0.16
2:    0.29
3:    0.32

$DetallSimple[[2]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.00 14.77  0.03  0.9768      0.01      0.00 0.9822
2:   Sleep on Old   0.13 19.00  2.65  0.0159      0.53      7.00 0.0100
3: Age on Control  -0.01 12.73 -0.20  0.8423      0.08      0.04 0.8622
4:      Age on SR   0.11 14.83  1.93  0.0727      0.42      3.73 0.0778
   EffSize.Boot
1:         0.01
2:         0.53
3:         0.10
4:         0.44

$DetallSimple[[2]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.00 14.77  0.03  0.9768      0.01      0.00 0.9689
2:   Sleep on Old   0.13 19.00  2.65  0.0159      0.54      7.00 0.0167
3: Age on Control  -0.01 12.73 -0.20  0.8423      0.10      0.04 0.8533
4:      Age on SR   0.11 14.83  1.93  0.0727      0.42      3.73 0.0678
5:      YSR vs OC  -0.02 15.56 -0.29  0.7755      0.12      0.08 0.7778
   EffSize.Boot
1:         0.01
2:         0.53
3:         0.09
4:         0.44
5:         0.10


$DetallSimple[[3]]
$DetallSimple[[3]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 0.74 0.396   0.74  0.396  0.84 0.3644 0.3990        0.383       
2:     Sleep 0.20 0.661   0.20  0.661  0.24 0.6272 0.6661        0.664       
3: Age*Sleep 2.10 0.158   0.14  0.360  0.99 0.3234 0.1937        0.130       
   EffSize
1:    0.13
2:    0.07
3:    0.36

$DetallSimple[[3]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.05 14.44 -0.65  0.5234      0.17      0.43 0.4811
2:   Sleep on Old   0.10 18.08  1.48  0.1563      0.30      2.19 0.1533
3: Age on Control  -0.03 14.26 -0.39  0.7011      0.11      0.15 0.7044
4:      Age on SR   0.12 16.98  1.75  0.0990      0.36      3.05 0.0989
   EffSize.Boot
1:         0.17
2:         0.31
3:         0.13
4:         0.36

$DetallSimple[[3]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.05 14.44 -0.65  0.5234      0.17      0.43 0.5267
2:   Sleep on Old   0.10 18.08  1.48  0.1563      0.36      2.19 0.1600
3: Age on Control  -0.03 14.26 -0.39  0.7011      0.11      0.15 0.7178
4:      Age on SR   0.12 16.98  1.75  0.0990      0.36      3.05 0.1000
5:      YSR vs OC   0.02 17.36  0.35  0.7341      0.07      0.12 0.7433
   EffSize.Boot
1:         0.17
2:         0.27
3:         0.09
4:         0.36
5:         0.08


$DetallSimple[[4]]
$DetallSimple[[4]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1 pBoot Sig pBootMas SigMas
1:       Age 6.07 0.020   6.07  0.020  5.47 0.0231    NA            1       
2:     Sleep 7.34 0.012   7.34  0.012 11.68 0.0012    NA            0  *    
3: Age*Sleep 0.54 0.468   0.22  0.100  2.46 0.1226    NA            0  *    
   EffSize
1:    0.40
2:    0.49
3:    0.25

$DetallSimple[[4]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.31 12.63 -2.85  0.0139      0.79      8.14 0.0144
2:   Sleep on Old  -0.18 15.15 -1.24  0.2347      0.36      1.53 0.2278
3: Age on Control   0.16 17.53  0.98  0.3381      0.27      0.97 0.3467
4:      Age on SR   0.29 15.46  3.33  0.0044      0.72     11.06 0.0089
   EffSize.Boot
1:         0.79
2:         0.33
3:         0.29
4:         0.72

$DetallSimple[[4]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.31 12.63 -2.85  0.0139      0.80      8.14 0.0078
2:   Sleep on Old  -0.18 15.15 -1.24  0.2347      0.31      1.53 0.2278
3: Age on Control   0.16 17.53  0.98  0.3381      0.29      0.97 0.3500
4:      Age on SR   0.29 15.46  3.33  0.0044      0.72     11.06 0.0044
5:      YSR vs OC   0.47 13.37  3.41  0.0045      0.72     11.62 0.0100
   EffSize.Boot
1:         0.79
2:         0.32
3:         0.28
4:         0.72
5:         0.70
Omnibus AOV. Design 2x2x(4xS)
Names Q p pBoot Sig pBootMas Sig2
Age 18.71 0.0000 0.0000
0.0001
Sleep 1.13 0.2882 0.2805 0.2828
Time 24.30 0.0000 0.0000
0.0000
Age*Sleep 3.88 0.0490 0.0584 0.0000
Age*Time 0.27 0.8505 0.3873 0.3686
Sleep*Time 0.68 0.5619 0.0851 0.0589
AgeSleepTime 0.11 0.9554 0.7279 0.7226
Interaction Age-Sleep. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1
Sleep on Young -0.33 50.19 -1.87 0.0675 0.53
Sleep on Old 0.07 37.17 0.38 0.7094 0.13
Age on Control 0.26 42.90 1.25 0.2189 0.55
Age on SR 0.66 59.48 4.34 0.0001 0.75
Interaction Age-Time. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1
Age on M1 0.28 33.62 2.46 0.0191 0.45
Age on M2 0.10 25.30 1.05 0.3051 0.16
Age on M3 0.09 29.90 0.86 0.3957 0.13
Age on M4 0.44 26.91 2.46 0.0204 0.40
M1-M2 on Young -1.21 NA -7.28 0.0001 0.92
M1-M2 on Old -1.36 NA -14.01 0.0000 0.95
M2-M3 on Young -0.01 NA -0.25 0.8086 0.00
M2-M3 on Old 0.07 NA 0.68 0.5184 0.01
M3-M4 on Young 0.73 NA 6.60 0.0002 0.79
M3-M4 on Old 0.96 NA 4.68 0.0016 0.90
Interaction Sleep-Time. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1
Sleep on M1 0.05 33.62 0.41 0.6809 0.07
Sleep on M2 0.13 25.30 1.41 0.1694 0.29
Sleep on M3 0.05 29.90 0.44 0.6608 0.07
Sleep on M4 -0.49 26.91 -2.71 0.0116 0.49
M1-M2 on Control -1.31 NA -7.97 0.0000 0.97
M1-M2 on SR -1.34 NA -8.59 0.0000 0.94
M2-M3 on Control 0.11 NA 1.15 0.2846 0.09
M2-M3 on SR 0.00 NA 0.01 0.9891 0.10
M3-M4 on Control 1.07 NA 6.88 0.0001 0.86
M3-M4 on SR 0.62 NA 3.76 0.0056 0.73
Main Effect Time. Design 2x2x(4xS)
Contr psihat test p.value Psihat2 p.value2 EfSize.V1
M1-M2 -2.61 -12.52 0.0000 -2.47 0.00 0.99
M2-M3 0.15 1.38 0.2053 -0.01 0.86 0.00
M3-M4 1.67 7.31 0.0001 1.72 0.00 0.87
Simple Effect Time each Age-Sleep condition. Design 2x2x(4xS)
Contr psihat df test p.value Psihat2 p.value2 dif.yuen df.yuen test.yuen EffSize.yuen pvaluet.yuen
M1-M2 on Y_C -0.55 NA -5.02 0.0010 -0.56 0.000 -0.56 8 -5.98 0.90 0.0003
M1-M2 on Y_SR -0.64 NA -8.81 0.0000 -0.59 0.000 -0.59 8 -7.82 0.94 0.0001
M1-M2 on O_C -0.77 NA -8.21 0.0000 -0.72 0.000 -0.72 10 -10.34 0.93 0.0000
M1-M2 on O_SR -0.62 NA -7.76 0.0001 -0.61 0.000 -0.61 9 -8.27 0.90 0.0000
M2-M3 on Y_C 0.04 NA 0.70 0.5024 0.03 0.632 0.03 8 0.45 0.08 0.6667
M2-M3 on Y_SR -0.01 NA -0.17 0.8660 -0.03 0.656 -0.03 8 -0.57 0.12 0.5825
M2-M3 on O_C 0.05 NA 0.92 0.3861 0.01 0.660 0.01 10 0.25 0.04 0.8099
M2-M3 on O_SR 0.00 NA 0.00 0.9973 -0.02 0.792 -0.02 9 -0.28 0.08 0.7884
M3-M4 on Y_C 0.49 NA 4.91 0.0012 0.47 0.000 0.47 8 4.63 0.93 0.0017
M3-M4 on Y_SR 0.26 NA 2.30 0.0508 0.21 0.012 0.22 9 3.17 0.66 0.0113
M3-M4 on O_C 0.56 NA 3.06 0.0156 0.66 0.000 0.66 10 4.56 0.84 0.0010
M3-M4 on O_SR 0.40 NA 3.39 0.0095 0.38 0.004 0.36 8 4.93 0.92 0.0012
Simple Effect Age-Sleep on Time=1 Omnibus AOV. Design 2x2x(4xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 6.06 0.019 6.06 0.019 6.74 0.0121 0.0167
0.026
0.44
Sleep 0.17 0.681 0.17 0.681 0.43 0.5160 0.6745 0.710 0.07
Age*Sleep 0.02 0.897 -0.10 0.510 0.22 0.6443 0.8114 0.891 0.08
Simple Effect Age-Sleep on Time=1 Simple Effects. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.03 15.91 0.39 0.6989 0.12 0.16 0.6967 0.12
Sleep on Old 0.02 17.73 0.20 0.8463 0.05 0.04 0.8311 0.06
Age on Control 0.15 17.08 1.91 0.0736 0.48 3.63 0.0811 0.47
Age on SR 0.13 16.78 1.59 0.1306 0.35 2.53 0.1367 0.33
Simple Effect Age-Sleep on Time=1 Extense Simple Effects. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.03 15.91 0.39 0.6989 0.12 0.16 0.7056 0.12
Sleep on Old 0.02 17.73 0.20 0.8463 0.06 0.04 0.8278 0.05
Age on Control 0.15 17.08 1.91 0.0736 0.46 3.63 0.0867 0.46
Age on SR 0.13 16.78 1.59 0.1306 0.33 2.53 0.1244 0.33
YSR vs OC 0.12 17.58 1.57 0.1345 0.37 2.46 0.1144 0.37
Simple Effect Age-Sleep on Time=2 Omnibus AOV. Design 2x2x(4xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 1.10 0.305 1.10 0.305 0.76 0.3875 0.3356 0.309 0.16
Sleep 2.00 0.169 2.00 0.169 2.10 0.1529 0.1970 0.176 0.29
Age*Sleep 1.86 0.185 0.18 0.230 1.58 0.2138 0.2387 0.164 0.32
Simple Effect Age-Sleep on Time=2 Simple Effects. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.00 14.77 0.03 0.9768 0.01 0.00 0.9822 0.01
Sleep on Old 0.13 19.00 2.65 0.0159 0.53 7.00 0.0100 0.53
Age on Control -0.01 12.73 -0.20 0.8423 0.08 0.04 0.8622 0.10
Age on SR 0.11 14.83 1.93 0.0727 0.42 3.73 0.0778 0.44
Simple Effect Age-Sleep on Time=2 Extense Simple Effects. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.00 14.77 0.03 0.9768 0.01 0.00 0.9689 0.01
Sleep on Old 0.13 19.00 2.65 0.0159 0.54 7.00 0.0167 0.53
Age on Control -0.01 12.73 -0.20 0.8423 0.10 0.04 0.8533 0.09
Age on SR 0.11 14.83 1.93 0.0727 0.42 3.73 0.0678 0.44
YSR vs OC -0.02 15.56 -0.29 0.7755 0.12 0.08 0.7778 0.10
Simple Effect Age-Sleep on Time=3 Omnibus AOV. Design 2x2x(4xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.74 0.396 0.74 0.396 0.84 0.3644 0.3990 0.383 0.13
Sleep 0.20 0.661 0.20 0.661 0.24 0.6272 0.6661 0.664 0.07
Age*Sleep 2.10 0.158 0.14 0.360 0.99 0.3234 0.1937 0.130 0.36
Simple Effect Age-Sleep on Time=3 Simple Effects. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.05 14.44 -0.65 0.5234 0.17 0.43 0.4811 0.17
Sleep on Old 0.10 18.08 1.48 0.1563 0.30 2.19 0.1533 0.31
Age on Control -0.03 14.26 -0.39 0.7011 0.11 0.15 0.7044 0.13
Age on SR 0.12 16.98 1.75 0.0990 0.36 3.05 0.0989 0.36
Simple Effect Age-Sleep on Time=3 Extense Simple Effects. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.05 14.44 -0.65 0.5234 0.17 0.43 0.5267 0.17
Sleep on Old 0.10 18.08 1.48 0.1563 0.36 2.19 0.1600 0.27
Age on Control -0.03 14.26 -0.39 0.7011 0.11 0.15 0.7178 0.09
Age on SR 0.12 16.98 1.75 0.0990 0.36 3.05 0.1000 0.36
YSR vs OC 0.02 17.36 0.35 0.7341 0.07 0.12 0.7433 0.08
Simple Effect Age-Sleep on Time=4 Omnibus AOV. Design 2x2x(4xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 6.07 0.020 6.07 0.020 5.47 0.0231 NA 1 0.40
Sleep 7.34 0.012 7.34 0.012 11.68 0.0012 NA 0
0.49
Age*Sleep 0.54 0.468 0.22 0.100 2.46 0.1226 NA 0
0.25
Simple Effect Age-Sleep on Time=4 Simple Effects. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.31 12.63 -2.85 0.0139 0.79 8.14 0.0144 0.79
Sleep on Old -0.18 15.15 -1.24 0.2347 0.36 1.53 0.2278 0.33
Age on Control 0.16 17.53 0.98 0.3381 0.27 0.97 0.3467 0.29
Age on SR 0.29 15.46 3.33 0.0044 0.72 11.06 0.0089 0.72
Simple Effect Age-Sleep on Time=4 Extense Simple Effects. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.31 12.63 -2.85 0.0139 0.80 8.14 0.0078 0.79
Sleep on Old -0.18 15.15 -1.24 0.2347 0.31 1.53 0.2278 0.32
Age on Control 0.16 17.53 0.98 0.3381 0.29 0.97 0.3500 0.28
Age on SR 0.29 15.46 3.33 0.0044 0.72 11.06 0.0044 0.72
YSR vs OC 0.47 13.37 3.41 0.0045 0.72 11.62 0.0100 0.70

## Fig 3D Average global remapping of unstable cells across trials {Design 2x2x(4xS)}

  NmBas="Fig3D UnstableCells"
  NmFAlL<-paste0(PathDesign,NmBas)
  if (!dir.exists(NmFAlL)) {dir.create(NmFAlL)}
  NmFAlL<-paste0(NmFAlL,"/")
  ResGen<-NA  

  rrt<-ExDataIS.3(nmF = paste0(PathDesign,"Cell_types (ANOVA_Overall_correlations).csv"),Vars = ,c(3,4,12,7:10),vIntP =c(4:7),lvlCh = list("HABxT1"="s1xs2", "T1xT2"="s2xs3","T2xT3"="s3xs4","T3xTest"="s4xs5"),TypCel = "Unstable")
  DatDT<-rrt$DT
  ArP<-rrt$Arp
  ExtendDT<-rrt$ExtendDT
  
  # For Simple Effects:
  DatEfS<-list()
  for(is in 1:4) {
    DatEfS[[is]]<-ExData.2b(nmF = paste0(PathDesign,"Cell_types (ANOVA_Overall_correlations).csv"),Vars = c(3:4,(6+is)),TypCel = "Unstable")
    names(DatEfS[[is]]$DT)[3]<-"DepV"
  }
  
  # Graphs
  Grp<- Grph.3(DatP = ExtendDT,"OPR",LblsP =c("Cell-Type Remapping Unstable Cells", "","Similarity Score"),ylmP =c(-0.5,1.2),hLin = T,lvIp = 4)
  Grp2=Grp
  
  #AOV
  names(rrt$DT)[4:7]<-c("T1","T2","T3","T4")
  ResGen<-AOVMx2(A=2,B=2,C=4,DatPas = rrt,DatEfSp = DatEfS,nBMM1 = 10000,nBMM2 = 1000,Prc = 2)
  AlmacenGen2(GrpP = Grp,Grp2P = Grp2,DataPas = ResGen,PathDesignP = PathDesign,NmBasP = NmBas,Typ=2)
  
  # Other Graphs
    GrpO<-Grph.3.Otros(ExtendDT,LblsP =c("Cell-Type Remapping Unstable Cells", "D","Similarity Score"))
    
    ExtendDTCol<-copy(ExtendDT)
    ExtendDTCol$Moment<-"All"
    ExtendDTCol<-data.table(rbind(ExtendDT,ExtendDTCol))
    Grp3<-Grph.3(DatP = ExtendDTCol,"OPR",LblsP =c("Cell-Type Remapping Unstable Cells", "D","Similarity Score"),ylmP =c(-0.5,1.2),hLin = T,lvIp = 5,wMain = T)
    
    pdf(paste0(NmFAlL,NmBas,"OtrosGraphs.pdf"))
      Grp3
      GrpO
    dev.off()

        # Results
        plot(Grp)
        plot(Grp2) # Only this graph is printed in the html file.
        GrpO
        plot(Grp3)
        ResGen # Lean option to view the results of statistical analysis
        
        Kbl3(ResPas = ResGen[[1]], lbl = "Omnibus AOV. Design 2x2x(4xS)");cat("\n")
        Kbl3(ResGen[[2]], "Interaction Age-Sleep. Design 2x2x(4xS)")
        Kbl3(ResGen[[3]], "Interaction Age-Time. Design 2x2x(4xS)")
        Kbl3(ResGen[[4]], "Interaction Sleep-Time. Design 2x2x(4xS)")
        Kbl3(ResGen[[5]], "Main Effect Time. Design 2x2x(4xS)")
        Kbl3(ResGen[[6]], "Simple Effect Time each Age-Sleep condition. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[1]][[1]], "Simple Effect Age-Sleep on Time=1 Omnibus AOV. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[1]][[2]], "Simple Effect Age-Sleep on Time=1 Simple Effects. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[1]][[3]], "Simple Effect Age-Sleep on Time=1 Extense Simple Effects. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[2]][[1]], "Simple Effect Age-Sleep on Time=2 Omnibus AOV. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[2]][[2]], "Simple Effect Age-Sleep on Time=2 Simple Effects. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[2]][[3]], "Simple Effect Age-Sleep on Time=2 Extense Simple Effects. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[3]][[1]], "Simple Effect Age-Sleep on Time=3 Omnibus AOV. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[3]][[2]], "Simple Effect Age-Sleep on Time=3 Simple Effects. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[3]][[3]], "Simple Effect Age-Sleep on Time=3 Extense Simple Effects. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[4]][[1]], "Simple Effect Age-Sleep on Time=4 Omnibus AOV. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[4]][[2]], "Simple Effect Age-Sleep on Time=4 Simple Effects. Design 2x2x(4xS)")
        Kbl3(ResGen[[7]][[4]][[3]], "Simple Effect Age-Sleep on Time=4 Extense Simple Effects. Design 2x2x(4xS)")
           Eff   p.V1 p.Sig
1:   p.value.A 0.5543      
2:   p.value.B 0.1803      
3:   p.value.C 0.0634      
4:  p.value.AB 0.1870      
5:  p.value.AC 0.6928      
6:  p.value.BC 0.6995      
7: p.value.ABC 0.2254      
           Eff   p.V1 p.Sig
1:   p.value.A 0.5552      
2:   p.value.B 0.1790      
3:   p.value.C 0.1032      
4:  p.value.AB 0.0034 *    
5:  p.value.AC 0.7779      
6:  p.value.BC 0.8236      
7: p.value.ABC 0.3139      
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
$BP

$Bars

$MargAB

$MargAC

$MargBC

$MargC

quartz_off_screen 
                2 
$BP

$Bars

$MargAB

$MargAC

$MargBC

$MargC

$AOV
            Names    Q      p  pBoot Sig pBootMas  Sig2
1:            Age 0.35 0.5557 0.5543       0.5552      
2:          Sleep 1.81 0.1792 0.1803       0.1790      
3:           Time 0.76 0.5161 0.0634       0.1032      
4:      Age*Sleep 1.85 0.1739 0.1870       0.0034 *    
5:       Age*Time 0.13 0.9409 0.6928       0.7779      
6:     Sleep*Time 0.11 0.9547 0.6995       0.8236      
7: Age*Sleep*Time 0.43 0.7304 0.2254       0.3139      

$InterAB
            Contr psihat    df  test p.value EfSize.V1
1: Sleep on Young   0.00 48.31  0.01  0.9891      0.14
2:   Sleep on Old  -0.50 47.87 -2.12  0.0391      0.40
3: Age on Control   0.36 45.93  1.60  0.1176      0.26
4:      Age on SR  -0.14 50.05 -0.60  0.5483      0.20

$InterAC
             Contr psihat    df  test p.value EfSize.V1
 1:      Age on M1   0.07 24.89  0.52  0.6075      0.07
 2:      Age on M2   0.02 25.24  0.10  0.9211      0.05
 3:      Age on M3  -0.09 35.23 -0.61  0.5447      0.13
 4:      Age on M4   0.22 27.18  1.08  0.2884      0.17
 5: M1-M2 on Young   0.11    NA  0.51  0.6307      0.08
 6:   M1-M2 on Old  -0.16    NA -2.30  0.0614      0.17
 7: M2-M3 on Young  -0.19    NA -0.73  0.4925      0.01
 8:   M2-M3 on Old  -0.07    NA -0.43  0.6810      0.09
 9: M3-M4 on Young   0.37    NA  1.30  0.2399      0.21
10:   M3-M4 on Old   0.55    NA  3.25  0.0174      0.51

$InterBC
               Contr psihat    df  test p.value EfSize.V1
 1:      Sleep on M1  -0.07 24.89 -0.53  0.6000      0.08
 2:      Sleep on M2  -0.22 25.24 -1.25  0.2219      0.23
 3:      Sleep on M3   0.00 35.23  0.02  0.9833      0.03
 4:      Sleep on M4  -0.22 27.18 -1.07  0.2953      0.12
 5: M1-M2 on Control   0.08    NA  0.60  0.5727      0.05
 6:      M1-M2 on SR  -0.23    NA -1.52  0.1799      0.22
 7: M2-M3 on Control  -0.34    NA -0.88  0.4144      0.16
 8:      M2-M3 on SR  -0.01    NA -0.03  0.9744      0.08
 9: M3-M4 on Control   0.54    NA  1.58  0.1657      0.42
10:      M3-M4 on SR   0.47    NA  2.66  0.0375      0.26

$DetallMainC
   Contr psihat  test p.value Psihat2 p.value2 EfSize.V1
1: M1-M2  -0.12 -0.40  0.7036   -0.18    0.356      0.12
2: M2-M3  -0.21 -0.51  0.6253   -0.04    0.828      0.04
3: M3-M4   0.70  1.42  0.2066    0.66    0.004      0.33

$DetallTrialCadaCondAB
            Contr psihat df  test p.value Psihat2 p.value2 dif.yuen df.yuen
 1:  M1-M2 on Y_C   0.01 NA  0.08  0.9424   -0.05    0.552    -0.05      14
 2: M1-M2 on Y_SR   0.02 NA  0.10  0.9236   -0.01    0.832    -0.01       8
 3:  M1-M2 on O_C   0.03 NA  0.37  0.7228    0.03    0.724     0.03       6
 4: M1-M2 on O_SR  -0.21 NA -2.14  0.0767   -0.15    0.132    -0.15      11
 5:  M2-M3 on Y_C  -0.27 NA -1.47  0.1927   -0.08    0.488    -0.08      14
 6: M2-M3 on Y_SR   0.01 NA  0.05  0.9596    0.12    0.348     0.12       8
 7:  M2-M3 on O_C  -0.12 NA -0.70  0.5086   -0.04    0.748    -0.04       6
 8: M2-M3 on O_SR  -0.06 NA -0.66  0.5316   -0.03    0.792    -0.03      11
 9:  M3-M4 on Y_C   0.29 NA  1.53  0.1771    0.18    0.140     0.18      14
10: M3-M4 on Y_SR   0.18 NA  2.88  0.0280    0.00    0.852     0.00       8
11:  M3-M4 on O_C   0.28 NA  1.89  0.1070    0.26    0.116     0.26       6
12: M3-M4 on O_SR   0.21 NA  1.51  0.1819    0.23    0.052     0.23      11
    test.yuen EffSize.yuen pvaluet.yuen
 1:     -0.64         0.13       0.5309
 2:     -0.14         0.04       0.8950
 3:      0.36         0.08       0.7289
 4:     -1.77         0.36       0.1047
 5:     -0.85         0.22       0.4087
 6:      1.11         0.29       0.3009
 7:     -0.32         0.10       0.7580
 8:     -0.22         0.06       0.8289
 9:      1.64         0.37       0.1225
10:     -0.03         0.01       0.9760
11:      2.08         0.56       0.0827
12:      1.74         0.52       0.1099

$DetallSimple
$DetallSimple[[1]]
$DetallSimple[[1]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 0.27 0.608   0.27  0.608  0.02 0.8925 0.5960        0.615       
2:     Sleep 0.28 0.600   0.28  0.600  0.18 0.6739 0.5876        0.597       
3: Age*Sleep 0.49 0.492   0.08  0.590  0.28 0.6016 0.5810        0.493       
   EffSize
1:    0.07
2:    0.07
3:    0.14

$DetallSimple[[1]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.08 21.89 -0.92  0.3673      0.21      0.85 0.3700
2:   Sleep on Old   0.01  9.87  0.11  0.9129      0.10      0.01 0.9267
3: Age on Control  -0.01 13.72 -0.11  0.9162      0.13      0.01 0.9222
4:      Age on SR   0.08 17.41  1.09  0.2892      0.26      1.19 0.3111
   EffSize.Boot
1:         0.22
2:         0.10
3:         0.11
4:         0.25

$DetallSimple[[1]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.08 21.89 -0.92  0.3673      0.18      0.85 0.3678
2:   Sleep on Old   0.01  9.87  0.11  0.9129      0.09      0.01 0.9011
3: Age on Control  -0.01 13.72 -0.11  0.9162      0.11      0.01 0.9289
4:      Age on SR   0.08 17.41  1.09  0.2892      0.26      1.19 0.3144
5:      YSR vs OC   0.07 10.69  0.68  0.5109      0.15      0.46 0.4978
   EffSize.Boot
1:         0.19
2:         0.11
3:         0.10
4:         0.26
5:         0.17


$DetallSimple[[2]]
$DetallSimple[[2]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 0.01 0.922   0.01  0.922  0.06 0.8139 0.9132        0.939       
2:     Sleep 1.57 0.222   1.57  0.222  1.76 0.1912 0.2070        0.216       
3: Age*Sleep 0.54 0.468  -0.09  0.570  0.36 0.5527 0.4992        0.490       
   EffSize
1:    0.05
2:    0.22
3:    0.15

$DetallSimple[[2]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.04 13.22 -0.41  0.6897      0.11      0.17 0.6756
2:   Sleep on Old  -0.17 13.13 -1.28  0.2221      0.34      1.64 0.2200
3: Age on Control   0.07  9.29  0.61  0.5542      0.21      0.38 0.5600
4:      Age on SR  -0.06 17.56 -0.44  0.6676      0.11      0.19 0.6633
   EffSize.Boot
1:         0.10
2:         0.36
3:         0.16
4:         0.11

$DetallSimple[[2]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.04 13.22 -0.41  0.6897      0.09      0.17 0.6889
2:   Sleep on Old  -0.17 13.13 -1.28  0.2221      0.35      1.64 0.2333
3: Age on Control   0.07  9.29  0.61  0.5542      0.16      0.38 0.5656
4:      Age on SR  -0.06 17.56 -0.44  0.6676      0.11      0.19 0.6811
5:      YSR vs OC   0.12 13.18  0.83  0.4232      0.28      0.68 0.4256
   EffSize.Boot
1:         0.10
2:         0.37
3:         0.20
4:         0.11
5:         0.26


$DetallSimple[[3]]
$DetallSimple[[3]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot   Sig pBootMas SigMas
1:       Age 0.37 0.545   0.37  0.545  0.22 0.6440 0.5593          0.542       
2:     Sleep 0.00 0.984   0.00  0.984  0.07 0.7982 0.9800          0.986       
3: Age*Sleep 4.87 0.034  -0.26  0.090  2.96 0.0920 0.0384 *        0.025  *    
   EffSize
1:    0.12
2:    0.03
3:    0.37

$DetallSimple[[3]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.16 20.59  1.51  0.1450      0.33      2.30 0.1389
2:   Sleep on Old  -0.15 14.87 -1.61  0.1281      0.40      2.60 0.1244
3: Age on Control   0.11 17.56  1.10  0.2843      0.30      1.22 0.2778
4:      Age on SR  -0.20 17.74 -2.04  0.0570      0.48      4.15 0.0400
   EffSize.Boot
1:         0.36
2:         0.36
3:         0.24
4:         0.46

$DetallSimple[[3]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.16 20.59  1.51  0.1450      0.37      2.30 0.1556
2:   Sleep on Old  -0.15 14.87 -1.61  0.1281      0.42      2.60 0.1389
3: Age on Control   0.11 17.56  1.10  0.2843      0.25      1.22 0.2856
4:      Age on SR  -0.20 17.74 -2.04  0.0570      0.47      4.15 0.0589
5:      YSR vs OC  -0.04 13.84 -0.44  0.6646      0.14      0.20 0.6822
   EffSize.Boot
1:         0.32
2:         0.40
3:         0.26
4:         0.48
5:         0.10


$DetallSimple[[4]]
$DetallSimple[[4]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 1.17 0.289   1.17  0.289  2.09 0.1548 0.2821        0.283       
2:     Sleep 1.14 0.296   1.14  0.296  1.68 0.2006 0.3189        0.293       
3: Age*Sleep 0.60 0.447  -0.14  0.350  0.94 0.3375 0.5008        0.449       
   EffSize
1:    0.16
2:    0.12
3:    0.22

$DetallSimple[[4]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.03 12.91 -0.20  0.8418      0.11      0.04 0.8367
2:   Sleep on Old  -0.19 14.57 -1.33  0.2035      0.35      1.77 0.2022
3: Age on Control   0.19 11.79  1.50  0.1603      0.43      2.25 0.1567
4:      Age on SR   0.03 15.63  0.20  0.8459      0.06      0.04 0.8333
   EffSize.Boot
1:         0.08
2:         0.40
3:         0.39
4:         0.06

$DetallSimple[[4]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.03 12.91 -0.20  0.8418      0.10      0.04 0.8533
2:   Sleep on Old  -0.19 14.57 -1.33  0.2035      0.38      1.77 0.1944
3: Age on Control   0.19 11.79  1.50  0.1603      0.39      2.25 0.1378
4:      Age on SR   0.03 15.63  0.20  0.8459      0.06      0.04 0.8322
5:      YSR vs OC   0.22 13.93  1.32  0.2079      0.38      1.74 0.2111
   EffSize.Boot
1:         0.08
2:         0.40
3:         0.35
4:         0.08
5:         0.37
Omnibus AOV. Design 2x2x(4xS)
Names Q p pBoot Sig pBootMas Sig2
Age 0.35 0.5557 0.5543 0.5552
Sleep 1.81 0.1792 0.1803 0.1790
Time 0.76 0.5161 0.0634 0.1032
Age*Sleep 1.85 0.1739 0.1870 0.0034
Age*Time 0.13 0.9409 0.6928 0.7779
Sleep*Time 0.11 0.9547 0.6995 0.8236
AgeSleepTime 0.43 0.7304 0.2254 0.3139
Interaction Age-Sleep. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1
Sleep on Young 0.00 48.31 0.01 0.9891 0.14
Sleep on Old -0.50 47.87 -2.12 0.0391 0.40
Age on Control 0.36 45.93 1.60 0.1176 0.26
Age on SR -0.14 50.05 -0.60 0.5483 0.20
Interaction Age-Time. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1
Age on M1 0.07 24.89 0.52 0.6075 0.07
Age on M2 0.02 25.24 0.10 0.9211 0.05
Age on M3 -0.09 35.23 -0.61 0.5447 0.13
Age on M4 0.22 27.18 1.08 0.2884 0.17
M1-M2 on Young 0.11 NA 0.51 0.6307 0.08
M1-M2 on Old -0.16 NA -2.30 0.0614 0.17
M2-M3 on Young -0.19 NA -0.73 0.4925 0.01
M2-M3 on Old -0.07 NA -0.43 0.6810 0.09
M3-M4 on Young 0.37 NA 1.30 0.2399 0.21
M3-M4 on Old 0.55 NA 3.25 0.0174 0.51
Interaction Sleep-Time. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1
Sleep on M1 -0.07 24.89 -0.53 0.6000 0.08
Sleep on M2 -0.22 25.24 -1.25 0.2219 0.23
Sleep on M3 0.00 35.23 0.02 0.9833 0.03
Sleep on M4 -0.22 27.18 -1.07 0.2953 0.12
M1-M2 on Control 0.08 NA 0.60 0.5727 0.05
M1-M2 on SR -0.23 NA -1.52 0.1799 0.22
M2-M3 on Control -0.34 NA -0.88 0.4144 0.16
M2-M3 on SR -0.01 NA -0.03 0.9744 0.08
M3-M4 on Control 0.54 NA 1.58 0.1657 0.42
M3-M4 on SR 0.47 NA 2.66 0.0375 0.26
Main Effect Time. Design 2x2x(4xS)
Contr psihat test p.value Psihat2 p.value2 EfSize.V1
M1-M2 -0.12 -0.40 0.7036 -0.18 0.356 0.12
M2-M3 -0.21 -0.51 0.6253 -0.04 0.828 0.04
M3-M4 0.70 1.42 0.2066 0.66 0.004 0.33
Simple Effect Time each Age-Sleep condition. Design 2x2x(4xS)
Contr psihat df test p.value Psihat2 p.value2 dif.yuen df.yuen test.yuen EffSize.yuen pvaluet.yuen
M1-M2 on Y_C 0.01 NA 0.08 0.9424 -0.05 0.552 -0.05 14 -0.64 0.13 0.5309
M1-M2 on Y_SR 0.02 NA 0.10 0.9236 -0.01 0.832 -0.01 8 -0.14 0.04 0.8950
M1-M2 on O_C 0.03 NA 0.37 0.7228 0.03 0.724 0.03 6 0.36 0.08 0.7289
M1-M2 on O_SR -0.21 NA -2.14 0.0767 -0.15 0.132 -0.15 11 -1.77 0.36 0.1047
M2-M3 on Y_C -0.27 NA -1.47 0.1927 -0.08 0.488 -0.08 14 -0.85 0.22 0.4087
M2-M3 on Y_SR 0.01 NA 0.05 0.9596 0.12 0.348 0.12 8 1.11 0.29 0.3009
M2-M3 on O_C -0.12 NA -0.70 0.5086 -0.04 0.748 -0.04 6 -0.32 0.10 0.7580
M2-M3 on O_SR -0.06 NA -0.66 0.5316 -0.03 0.792 -0.03 11 -0.22 0.06 0.8289
M3-M4 on Y_C 0.29 NA 1.53 0.1771 0.18 0.140 0.18 14 1.64 0.37 0.1225
M3-M4 on Y_SR 0.18 NA 2.88 0.0280 0.00 0.852 0.00 8 -0.03 0.01 0.9760
M3-M4 on O_C 0.28 NA 1.89 0.1070 0.26 0.116 0.26 6 2.08 0.56 0.0827
M3-M4 on O_SR 0.21 NA 1.51 0.1819 0.23 0.052 0.23 11 1.74 0.52 0.1099
Simple Effect Age-Sleep on Time=1 Omnibus AOV. Design 2x2x(4xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.27 0.608 0.27 0.608 0.02 0.8925 0.5960 0.615 0.07
Sleep 0.28 0.600 0.28 0.600 0.18 0.6739 0.5876 0.597 0.07
Age*Sleep 0.49 0.492 0.08 0.590 0.28 0.6016 0.5810 0.493 0.14
Simple Effect Age-Sleep on Time=1 Simple Effects. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.08 21.89 -0.92 0.3673 0.21 0.85 0.3700 0.22
Sleep on Old 0.01 9.87 0.11 0.9129 0.10 0.01 0.9267 0.10
Age on Control -0.01 13.72 -0.11 0.9162 0.13 0.01 0.9222 0.11
Age on SR 0.08 17.41 1.09 0.2892 0.26 1.19 0.3111 0.25
Simple Effect Age-Sleep on Time=1 Extense Simple Effects. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.08 21.89 -0.92 0.3673 0.18 0.85 0.3678 0.19
Sleep on Old 0.01 9.87 0.11 0.9129 0.09 0.01 0.9011 0.11
Age on Control -0.01 13.72 -0.11 0.9162 0.11 0.01 0.9289 0.10
Age on SR 0.08 17.41 1.09 0.2892 0.26 1.19 0.3144 0.26
YSR vs OC 0.07 10.69 0.68 0.5109 0.15 0.46 0.4978 0.17
Simple Effect Age-Sleep on Time=2 Omnibus AOV. Design 2x2x(4xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.01 0.922 0.01 0.922 0.06 0.8139 0.9132 0.939 0.05
Sleep 1.57 0.222 1.57 0.222 1.76 0.1912 0.2070 0.216 0.22
Age*Sleep 0.54 0.468 -0.09 0.570 0.36 0.5527 0.4992 0.490 0.15
Simple Effect Age-Sleep on Time=2 Simple Effects. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.04 13.22 -0.41 0.6897 0.11 0.17 0.6756 0.10
Sleep on Old -0.17 13.13 -1.28 0.2221 0.34 1.64 0.2200 0.36
Age on Control 0.07 9.29 0.61 0.5542 0.21 0.38 0.5600 0.16
Age on SR -0.06 17.56 -0.44 0.6676 0.11 0.19 0.6633 0.11
Simple Effect Age-Sleep on Time=2 Extense Simple Effects. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.04 13.22 -0.41 0.6897 0.09 0.17 0.6889 0.10
Sleep on Old -0.17 13.13 -1.28 0.2221 0.35 1.64 0.2333 0.37
Age on Control 0.07 9.29 0.61 0.5542 0.16 0.38 0.5656 0.20
Age on SR -0.06 17.56 -0.44 0.6676 0.11 0.19 0.6811 0.11
YSR vs OC 0.12 13.18 0.83 0.4232 0.28 0.68 0.4256 0.26
Simple Effect Age-Sleep on Time=3 Omnibus AOV. Design 2x2x(4xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.37 0.545 0.37 0.545 0.22 0.6440 0.5593 0.542 0.12
Sleep 0.00 0.984 0.00 0.984 0.07 0.7982 0.9800 0.986 0.03
Age*Sleep 4.87 0.034 -0.26 0.090 2.96 0.0920 0.0384
0.025
0.37
Simple Effect Age-Sleep on Time=3 Simple Effects. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.16 20.59 1.51 0.1450 0.33 2.30 0.1389 0.36
Sleep on Old -0.15 14.87 -1.61 0.1281 0.40 2.60 0.1244 0.36
Age on Control 0.11 17.56 1.10 0.2843 0.30 1.22 0.2778 0.24
Age on SR -0.20 17.74 -2.04 0.0570 0.48 4.15 0.0400 0.46
Simple Effect Age-Sleep on Time=3 Extense Simple Effects. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.16 20.59 1.51 0.1450 0.37 2.30 0.1556 0.32
Sleep on Old -0.15 14.87 -1.61 0.1281 0.42 2.60 0.1389 0.40
Age on Control 0.11 17.56 1.10 0.2843 0.25 1.22 0.2856 0.26
Age on SR -0.20 17.74 -2.04 0.0570 0.47 4.15 0.0589 0.48
YSR vs OC -0.04 13.84 -0.44 0.6646 0.14 0.20 0.6822 0.10
Simple Effect Age-Sleep on Time=4 Omnibus AOV. Design 2x2x(4xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 1.17 0.289 1.17 0.289 2.09 0.1548 0.2821 0.283 0.16
Sleep 1.14 0.296 1.14 0.296 1.68 0.2006 0.3189 0.293 0.12
Age*Sleep 0.60 0.447 -0.14 0.350 0.94 0.3375 0.5008 0.449 0.22
Simple Effect Age-Sleep on Time=4 Simple Effects. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.03 12.91 -0.20 0.8418 0.11 0.04 0.8367 0.08
Sleep on Old -0.19 14.57 -1.33 0.2035 0.35 1.77 0.2022 0.40
Age on Control 0.19 11.79 1.50 0.1603 0.43 2.25 0.1567 0.39
Age on SR 0.03 15.63 0.20 0.8459 0.06 0.04 0.8333 0.06
Simple Effect Age-Sleep on Time=4 Extense Simple Effects. Design 2x2x(4xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.03 12.91 -0.20 0.8418 0.10 0.04 0.8533 0.08
Sleep on Old -0.19 14.57 -1.33 0.2035 0.38 1.77 0.1944 0.40
Age on Control 0.19 11.79 1.50 0.1603 0.39 2.25 0.1378 0.35
Age on SR 0.03 15.63 0.20 0.8459 0.06 0.04 0.8322 0.08
YSR vs OC 0.22 13.93 1.32 0.2079 0.38 1.74 0.2111 0.37

5 Figure 4. Place cell stability during unmoved object control task


Figure 4. Place cell stability during unmoved object control task. A) Schematics of the task. B) Isolation distance showing absence of differences in spike cluster quality across conditions over time. C-E) Examples of context (C), object configuration (D), and unstable (D) rate maps, trajectory spike maps, and waveforms recorded from young and old control mice trained in the unmoved object control task. Context and object configuration cells recorded in young mice were more stable during the test than those recorded in old controls. Unstable cells did not show differences across groups and/or time. Blue indicates that the animal has visited the region but the cell has not fired, vivid colors indicate high neuronal activity (as shown in the color bar at the upper right corner). Number on top of each map represents peak firing rate (Hz) used to normalize the map colors. Red dots on the trajectory maps indicate location of action potentials. Waveform similarity indicates recording stability during the 24 hr period of training and testing. Young: 3 mice, 30 cells, old: 4 mice, 24 cells. Asterisks (*) represent significance using alpha=0.05. Statistical details in Supplemental Statistical Table corresponding to Figure 4.


5.1 Fig 4B Unmoved Isolation distance {Design 2x(5xS)}

  NmBas="Fig4B UnMovedIsolationDistance"
  NmFAlL<-paste0(PathDesign,NmBas)
  if (!dir.exists(NmFAlL)) {dir.create(NmFAlL)}
  NmFAlL<-paste0(NmFAlL,"/")
  ResGen<-NA
    
  rrt<-ExDataIS.3c(nmF = paste0(PathDesign,"ClusterQualityNonMovedControl.csv"),Vars = ,c(4,5,1,6:10),vIntP =c(4:8),lvlCh = list("HAB"="id_s1", "T1"="id_s2","T2"="id_s3","T3"="id_s4","Test"="id_s5"))
  DatDT<-rrt$DT
  ArP<-rrt$Arp
  ExtendDT<-rrt$ExtendDT
  
  #Graphs
  Grp<- Grph.3b(DatP = ExtendDT,"OPR",LblsP =c("Cluster Quality", "","Isolation Distance"),ylmP =c(0,40),hLin = F,lvIp = 5,GrpSel = c(1,3))

  Grp2=Grp
  
  #AOV
  names(rrt$DT)[3:7]<-c("T1","T2","T3","T4","T5")
  ResGen<-AOVMx2b(A=2,C=5,DatPas = rrt,DatEfSp = DatEfS,nBMM1 = 10000,nBMM2 = 1000,Prc = 2)
  AlmacenGen(GrpP = Grp,Grp2P = Grp2,DataPas = ResGen,PathDesignP = PathDesign,NmBasP = NmBas,Typ=1)
  
   # Other Graphs
    ExtendDTCol<-copy(ExtendDT)
    ExtendDTCol$Moment<-"All"
    ExtendDTCol<-data.table(rbind(ExtendDT,ExtendDTCol))
    
    Grp3<- Grph.3b(DatP = ExtendDTCol,"OPR",LblsP =c("Cluster Quality", "","Isolation Distance"),ylmP =c(0,40),hLin = F,lvIp = 6,GrpSel = c(1,3),wMain = T)
    
    ExtendCpy<-copy(ExtendDT)
    names(ExtendCpy)[1]<-"Age"
    GrpO<-Grph.3.Otrosb(ExtendDTp = ExtendCpy,LblsP =c("Cluster Quality", "","Isolation Distance"))
    
    pdf(paste0(NmFAlL,NmBas,"OtrosGraphs.pdf"))
      Grp3
      GrpO
    dev.off()

        # Results
        plot(Grp)
        plot(Grp2) # Only this graph is printed in the html file.
        ResGen  # Lean option to view the results of statistical analysis
        
        Kbl3(ResGen[[1]], "Omnibus AOV. Design 2x(5xS)");cat("\n")
        Kbl3(ResGen[[2]], "Simple Effects Age-Time. Design 2x(5xS)")
        Kbl3(ResGen[[3]], "Main Effects of Time. Design 2x(5xS)")
[1] "Taking bootstrap samples. Please wait."
[1] "Taking bootstrap samples. Please wait."
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
$BP

$Bars

$MargAC

$MargC

quartz_off_screen 
                2 
$AOV
       Names    Q      p  pBoot Sig pBootMas Sig2 EffSize
1:       Age 0.44 0.5095 0.5058       0.5102         0.13
2:     Trial 2.57 0.0616 0.0534       0.0573         0.10
3: Age*Trial 0.20 0.9358 0.9232       0.9363         0.05

$InterAC
             Contr psihat    df  test p.value EfSize.V1
 1:      Age on M1   0.21 18.11  0.17  0.8634      0.04
 2:      Age on M2   0.29 27.22  0.26  0.7969      0.06
 3:      Age on M3   0.76 29.58  0.69  0.4957      0.14
 4:      Age on M4   0.65 29.90  0.64  0.5280      0.12
 5:      Age on M5   0.99 29.53  1.14  0.2653      0.21
 6: M1-M2 on Young   0.11    NA  0.25  0.8046      0.03
 7:   M1-M2 on Old   0.05    NA  0.13  0.9015      0.01
 8: M2-M3 on Young  -0.67    NA -1.33  0.2054      0.20
 9:   M2-M3 on Old  -0.14    NA -0.27  0.7918      0.11
10: M3-M4 on Young   0.71    NA  1.88  0.0825      0.17
11:   M3-M4 on Old   0.26    NA  0.65  0.5296      0.16
12: M4-M5 on Young  -0.45    NA -0.41  0.6895      0.07
13:   M4-M5 on Old  -0.22    NA -0.30  0.7678      0.01

$DetallMainC
   Contr psihat  test p.value Psihat2 p.value2 EfSize.V1
1: M1-M2  -0.10 -0.14  0.8926   -0.18    0.964      0.05
2: M2-M3  -0.74 -0.74  0.4745   -1.66    0.092      0.17
3: M3-M4   1.37  2.08  0.0576    1.73    0.000      0.17
4: M4-M5  -1.94 -1.00  0.3372   -0.45    0.716      0.06
Omnibus AOV. Design 2x(5xS)
Names Q p pBoot Sig pBootMas Sig2 EffSize
Age 0.44 0.5095 0.5058 0.5102 0.13
Trial 2.57 0.0616 0.0534 0.0573 0.10
Age*Trial 0.20 0.9358 0.9232 0.9363 0.05
Simple Effects Age-Time. Design 2x(5xS)
Contr psihat df test p.value EfSize.V1
Age on M1 0.21 18.11 0.17 0.8634 0.04
Age on M2 0.29 27.22 0.26 0.7969 0.06
Age on M3 0.76 29.58 0.69 0.4957 0.14
Age on M4 0.65 29.90 0.64 0.5280 0.12
Age on M5 0.99 29.53 1.14 0.2653 0.21
M1-M2 on Young 0.11 NA 0.25 0.8046 0.03
M1-M2 on Old 0.05 NA 0.13 0.9015 0.01
M2-M3 on Young -0.67 NA -1.33 0.2054 0.20
M2-M3 on Old -0.14 NA -0.27 0.7918 0.11
M3-M4 on Young 0.71 NA 1.88 0.0825 0.17
M3-M4 on Old 0.26 NA 0.65 0.5296 0.16
M4-M5 on Young -0.45 NA -0.41 0.6895 0.07
M4-M5 on Old -0.22 NA -0.30 0.7678 0.01
Main Effects of Time. Design 2x(5xS)
Contr psihat test p.value Psihat2 p.value2 EfSize.V1
M1-M2 -0.10 -0.14 0.8926 -0.18 0.964 0.05
M2-M3 -0.74 -0.74 0.4745 -1.66 0.092 0.17
M3-M4 1.37 2.08 0.0576 1.73 0.000 0.17
M4-M5 -1.94 -1.00 0.3372 -0.45 0.716 0.06

5.2 Fig 4C Unmoved Controls Global Remapping Context Cells {Design 2x(4xS)}

  NmBas="Fig4C UnMovedContextCells"
  NmFAlL<-paste0(PathDesign,NmBas)
  if (!dir.exists(NmFAlL)) {dir.create(NmFAlL)}
  NmFAlL<-paste0(NmFAlL,"/")
  ResGen<-NA

  rrt<-ExDataIS.3b(nmF = paste0(PathDesign,"NonMovedControls Final.csv"),Vars = ,c(3,4,12,7:10),vIntP =c(4:7),lvlCh = list("HABxT1"="s1xs2", "T1xT2"="s2xs3","T2xT3"="s3xs4","T3xTest"="s4xs5"),TypCel = "Context")
  DatDT<-rrt$DT
  ArP<-rrt$Arp
  ExtendDT<-rrt$ExtendDT
  
  #Graphs
  Grp<- Grph.3b(DatP = ExtendDT,"OPR",LblsP =c("Unmoved Object Control Context Cells", "","Similarity Score"),ylmP =c(-0.5,1.2),hLin = T,lvIp = 4,GrpSel = c(1,3))
  
  levBp<-seq(0.82, 25, by=4/12)
  Grp2<- Grp + 
    geom_signif(annotation=c("*"),
              y_position=c(1),
              xmin=c(levBp[9+1]),
              xmax=c(levBp[9+2]), 
              tip_length = c(.02,.4),vjust=0.5,textsize=10) +
      geom_signif(annotation=c("","","*"),
              y_position=c(-.25,-.25,-.3),
              xmin=c(levBp[6+1],levBp[9+1], mean(levBp[c(6+1,6+2)])),
              xmax=c(levBp[6+2],levBp[9+2], mean(levBp[c(9+1,9+2)])), 
              tip_length = c(c(-0.65,-0.4,-0.4,-0.02),c(-.04,-.04)),vjust=2,textsize=10)
  
  #AOV
  names(rrt$DT)[3:6]<-c("T1","T2","T3","T4")
  ResGen<-AOVMx2b(A=2,C=4,DatPas = rrt,DatEfSp = DatEfS,nBMM1 = 10000,nBMM2 = 1000,Prc = 2)
  AlmacenGen(GrpP = Grp,Grp2P = Grp2,DataPas = ResGen,PathDesignP = PathDesign,NmBasP = NmBas,Typ=1)
  
  # Other Graphs
    ExtendDTCol<-copy(ExtendDT)
    ExtendDTCol$Moment<-"All"
    ExtendDTCol<-data.table(rbind(ExtendDT,ExtendDTCol))
    
    Grp3<- Grph.3b(DatP = ExtendDTCol,"OPR",LblsP =c("Unmoved Object Control Context Cells", "","Similarity Score"),ylmP =c(-0.5,1.2),hLin = T,lvIp = 5,GrpSel = c(1,3),wMain = T)
    
    pdf(paste0(NmFAlL,NmBas,"OtrosGraphs.pdf"))
      Grp3
    dev.off()
  
      # Results
      plot(Grp)
      plot(Grp2) # Only this graph is printed in the html file.
      ResGen  # Lean option to view the results of statistical analysis
      
      Kbl3(ResGen[[1]], "Omnibus AOV Design 2x(4xS)");cat("\n")
      Kbl3(ResGen[[2]], "Simple Effects Age-Time Design 2x(4xS)")
      Kbl3(ResGen[[3]], "Main Effects Time Design 2x(4xS)")
[1] "Taking bootstrap samples. Please wait."
Error in solve.default(test) : 
  sistema es computacionalmente singular: número de condición recíproco = 5.97064e-17
Error in round(unlist(ResRo$BT), Prc) : 
  non-numeric argument to mathematical function
Error in round(unlist(DTpp), decim) : 
  non-numeric argument to mathematical function
[1] "Taking bootstrap samples. Please wait."
Error in solve.default(test) : 
  sistema es computacionalmente singular: número de condición recíproco = 5.97064e-17
Error in round(unlist(DTpp), decim) : 
  non-numeric argument to mathematical function
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
quartz_off_screen 
                2 
$AOV
       Names    Q      p pBoot Sig pBootMas Sig2 EffSize
1:       Age 3.90 0.0996    NA  NA       NA   NA    0.54
2:     Trial 7.97 0.0335    NA  NA       NA   NA    0.52
3: Age*Trial 2.51 0.1921    NA  NA       NA   NA    0.55

$InterAC
             Contr psihat   df  test p.value EfSize.V1
 1:      Age on M1   0.10 4.40  0.87  0.4304      0.39
 2:      Age on M2   0.02 5.14  0.11  0.9200      0.04
 3:      Age on M3   0.16 4.94  1.20  0.2853      0.42
 4:      Age on M4   0.53 5.73  3.49  0.0139      0.89
 5: M1-M2 on Young  -0.12   NA -0.67  0.5522      0.31
 6:   M1-M2 on Old  -0.20   NA -0.74  0.5113      0.43
 7: M2-M3 on Young  -0.05   NA -0.32  0.7667      0.21
 8:   M2-M3 on Old   0.09   NA  0.50  0.6497      0.17
 9: M3-M4 on Young   0.17   NA  1.49  0.2339      0.59
10:   M3-M4 on Old   0.55   NA  2.91  0.0622      0.94

$DetallMainC
   Contr psihat  test p.value Psihat2 p.value2 EfSize.V1
1: M1-M2  -0.32 -0.77  0.4956   -0.32    0.108      0.51
2: M2-M3   0.04  0.17  0.8778    0.04    0.484      0.08
3: M3-M4   0.72  3.51  0.0393    0.72    0.000      0.75
Omnibus AOV Design 2x(4xS)
Names Q p pBoot Sig pBootMas Sig2 EffSize
Age 3.90 0.0996 NA NA NA NA 0.54
Trial 7.97 0.0335 NA NA NA NA 0.52
Age*Trial 2.51 0.1921 NA NA NA NA 0.55
Simple Effects Age-Time Design 2x(4xS)
Contr psihat df test p.value EfSize.V1
Age on M1 0.10 4.40 0.87 0.4304 0.39
Age on M2 0.02 5.14 0.11 0.9200 0.04
Age on M3 0.16 4.94 1.20 0.2853 0.42
Age on M4 0.53 5.73 3.49 0.0139 0.89
M1-M2 on Young -0.12 NA -0.67 0.5522 0.31
M1-M2 on Old -0.20 NA -0.74 0.5113 0.43
M2-M3 on Young -0.05 NA -0.32 0.7667 0.21
M2-M3 on Old 0.09 NA 0.50 0.6497 0.17
M3-M4 on Young 0.17 NA 1.49 0.2339 0.59
M3-M4 on Old 0.55 NA 2.91 0.0622 0.94
Main Effects Time Design 2x(4xS)
Contr psihat test p.value Psihat2 p.value2 EfSize.V1
M1-M2 -0.32 -0.77 0.4956 -0.32 0.108 0.51
M2-M3 0.04 0.17 0.8778 0.04 0.484 0.08
M3-M4 0.72 3.51 0.0393 0.72 0.000 0.75

5.3 Fig 4D Unmoved Controls Global Remapping Object configuration Cells {Design 2x(4xS)}

  NmBas="Fig4D UnMovedObjectCells"
  NmFAlL<-paste0(PathDesign,NmBas)
  if (!dir.exists(NmFAlL)) {dir.create(NmFAlL)}
  NmFAlL<-paste0(NmFAlL,"/")
  ResGen<-NA

  rrt<-ExDataIS.3b(nmF = paste0(PathDesign,"NonMovedControls Final.csv"),Vars = ,c(3,4,12,7:10),vIntP =c(4:7),lvlCh = list("HABxT1"="s1xs2", "T1xT2"="s2xs3","T2xT3"="s3xs4","T3xTest"="s4xs5"),TypCel = "Object")
  DatDT<-rrt$DT
  ArP<-rrt$Arp
  ExtendDT<-rrt$ExtendDT
  
  Grp<- Grph.3b(DatP = ExtendDT,"OPR",LblsP =c("Object Exploration", "","Similarity Score"),ylmP =c(-0.5,1.2),hLin = T,lvIp = 4,GrpSel = c(1,3))
  
  levBp<-seq(0.82, 25, by=4/12)
  Grp2<- Grp + geom_signif(annotation=c("*"),
              y_position=c(1),
              xmin=c(levBp[9+1]),
              xmax=c(levBp[9+2]), 
              tip_length = c(.02,.02),vjust=0.5,textsize=6)
   
  #AOV
  names(rrt$DT)[3:6]<-c("T1","T2","T3","T4")
  ResGen<-AOVMx2b(A=2,C=4,DatPas = rrt,DatEfSp = DatEfS,nBMM1 = 10000,nBMM2 = 1000,Prc = 2)
  
  AlmacenGen(GrpP = Grp,Grp2P = Grp2,DataPas = ResGen,PathDesignP = PathDesign,NmBasP = NmBas,Typ=1)
  
  # Other Graphs
    ExtendDTCol<-copy(ExtendDT)
    ExtendDTCol$Moment<-"All"
    ExtendDTCol<-data.table(rbind(ExtendDT,ExtendDTCol))
    
    Grp3<- Grph.3b(DatP = ExtendDTCol,"OPR",LblsP =c("Unmoved Object Control Context Cells", "","Similarity Score"),ylmP =c(-0.5,1.2),hLin = T,lvIp = 5,GrpSel = c(1,3),wMain = T)
    

    pdf(paste0(NmFAlL,NmBas,"OtrosGraphs.pdf"))
      Grp3
    dev.off()
  
        # Results
        plot(Grp)
        plot(Grp2) # Only this graph is printed in the html file.
        ResGen  # Lean option to view the results of statistical analysis
        
        Kbl3(ResGen[[1]], "Omnibus AOV Design 2x(4xS)");cat("\n")
        Kbl3(ResGen[[2]], "Simple Effects Age-Time Design 2x(4xS)")
        Kbl3(ResGen[[3]], "Main Effects Time Design 2x(4xS)")
[1] "Taking bootstrap samples. Please wait."
Error in listm(x) : The argument x must be a matrix or data frame
Error in round(unlist(ResRo$BT), Prc) : 
  non-numeric argument to mathematical function
Error in round(unlist(DTpp), decim) : 
  non-numeric argument to mathematical function
[1] "Taking bootstrap samples. Please wait."
Error in listm(x) : The argument x must be a matrix or data frame
Error in round(unlist(DTpp), decim) : 
  non-numeric argument to mathematical function
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
quartz_off_screen 
                2 
$AOV
       Names     Q      p pBoot Sig pBootMas Sig2 EffSize
1:       Age  0.04 0.8494    NA  NA       NA   NA    0.15
2:     Trial 13.37 0.0035    NA  NA       NA   NA    0.71
3: Age*Trial  4.85 0.0430    NA  NA       NA   NA    0.67

$InterAC
             Contr psihat   df  test p.value EfSize.V1
 1:      Age on M1  -0.30 2.37 -2.11  0.1494      0.90
 2:      Age on M2  -0.02 3.26 -0.13  0.9078      0.20
 3:      Age on M3  -0.02 2.92 -0.12  0.9145      0.12
 4:      Age on M4   0.28 6.83  4.75  0.0022      0.77
 5: M1-M2 on Young  -0.57   NA -4.13  0.0540      0.94
 6:   M1-M2 on Old  -0.36   NA -3.05  0.0926      0.85
 7: M2-M3 on Young  -0.24   NA -1.16  0.3667      0.56
 8:   M2-M3 on Old  -0.19   NA -5.17  0.0354      0.47
 9: M3-M4 on Young   0.14   NA  2.58  0.1229      0.61
10:   M3-M4 on Old   0.46   NA  2.57  0.1236      0.83

$DetallMainC
   Contr psihat  test p.value Psihat2 p.value2 EfSize.V1
1: M1-M2  -0.93 -3.83  0.0620   -1.06       NA      0.86
2: M2-M3  -0.35 -2.12  0.1687   -0.37       NA      0.48
3: M3-M4   0.59  4.20  0.0524    0.60       NA      0.77
Omnibus AOV Design 2x(4xS)
Names Q p pBoot Sig pBootMas Sig2 EffSize
Age 0.04 0.8494 NA NA NA NA 0.15
Trial 13.37 0.0035 NA NA NA NA 0.71
Age*Trial 4.85 0.0430 NA NA NA NA 0.67
Simple Effects Age-Time Design 2x(4xS)
Contr psihat df test p.value EfSize.V1
Age on M1 -0.30 2.37 -2.11 0.1494 0.90
Age on M2 -0.02 3.26 -0.13 0.9078 0.20
Age on M3 -0.02 2.92 -0.12 0.9145 0.12
Age on M4 0.28 6.83 4.75 0.0022 0.77
M1-M2 on Young -0.57 NA -4.13 0.0540 0.94
M1-M2 on Old -0.36 NA -3.05 0.0926 0.85
M2-M3 on Young -0.24 NA -1.16 0.3667 0.56
M2-M3 on Old -0.19 NA -5.17 0.0354 0.47
M3-M4 on Young 0.14 NA 2.58 0.1229 0.61
M3-M4 on Old 0.46 NA 2.57 0.1236 0.83
Main Effects Time Design 2x(4xS)
Contr psihat test p.value Psihat2 p.value2 EfSize.V1
M1-M2 -0.93 -3.83 0.0620 -1.06 NA 0.86
M2-M3 -0.35 -2.12 0.1687 -0.37 NA 0.48
M3-M4 0.59 4.20 0.0524 0.60 NA 0.77

5.4 Fig 4E Unmoved Controls Global Remapping Unstable Cells {Design 2x(4xS)}

  NmBas="Fig4E UnMovedUnstableCells"
  NmFAlL<-paste0(PathDesign,NmBas)
  if (!dir.exists(NmFAlL)) {dir.create(NmFAlL)}
  NmFAlL<-paste0(NmFAlL,"/")
  ResGen<-NA

  rrt<-ExDataIS.3b(nmF = paste0(PathDesign,"NonMovedControls Final.csv"),Vars = ,c(3,4,12,7:10),vIntP =c(4:7),lvlCh = list("HABxT1"="s1xs2", "T1xT2"="s2xs3","T2xT3"="s3xs4","T3xTest"="s4xs5"),TypCel = "Unstable")
  DatDT<-rrt$DT
  ArP<-rrt$Arp
  ExtendDT<-rrt$ExtendDT
  
  Grp<- Grph.3b(DatP = ExtendDT,"OPR",LblsP =c("Object Exploration", "","Similarity Score"),ylmP =c(-0.5,1.2),hLin = T,lvIp = 4,GrpSel = c(1,3))
  Grp2=Grp
   
   #AOV
  # DatEfS Absent because there are are not A*B factorial design
  names(rrt$DT)[3:6]<-c("T1","T2","T3","T4")
  ResGen<-AOVMx2b(A=2,C=4,DatPas = rrt,nBMM1 = 10000,nBMM2 = 1000,Prc = 2)
  
  AlmacenGen(GrpP = Grp,Grp2P = Grp2,DataPas = ResGen,PathDesignP = PathDesign,NmBasP = NmBas,Typ=1)
  
  # Other Graphs
    ExtendDTCol<-copy(ExtendDT)
    ExtendDTCol$Moment<-"All"
    ExtendDTCol<-data.table(rbind(ExtendDT,ExtendDTCol))
    
    Grp3<- Grph.3b(DatP = ExtendDTCol,"OPR",LblsP =c("Unmoved Object Control Context Cells", "","Similarity Score"),ylmP =c(-0.5,1.2),hLin = T,lvIp = 5,GrpSel = c(1,3),wMain = T)
    
    pdf(paste0(NmFAlL,NmBas,"OtrosGraphs.pdf"))
      Grp3
    dev.off()
  
        # Results
        plot(Grp)
        plot(Grp2) # Only this graph is printed in the html file.
        ResGen  # Lean option to view the results of statistical analysis
        
        Kbl3(ResGen[[1]], "Omnibus AOV Design 2x(4xS)");cat("\n")
        Kbl3(ResGen[[2]], "Simple Effects Age-Time Design 2x(4xS)")
        Kbl3(ResGen[[3]], "Main Effects Time Design 2x(4xS)")
[1] "Taking bootstrap samples. Please wait."
[1] "Taking bootstrap samples. Please wait."
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
quartz_off_screen 
                2 
$AOV
       Names    Q      p  pBoot Sig pBootMas Sig2 EffSize
1:       Age 0.20 0.6613 0.7346       0.7246         0.07
2:     Trial 0.48 0.7010 0.7479       0.7481         0.12
3: Age*Trial 0.23 0.8765 0.9299       0.9041         0.11

$InterAC
             Contr psihat    df  test p.value EfSize.V1
 1:      Age on M1   0.03 19.82  0.37  0.7184      0.10
 2:      Age on M2  -0.04 20.00 -0.48  0.6355      0.13
 3:      Age on M3   0.07 13.25  0.63  0.5422      0.15
 4:      Age on M4   0.04 14.40  0.26  0.7969      0.07
 5: M1-M2 on Young  -0.02    NA -0.15  0.8870      0.10
 6:   M1-M2 on Old   0.02    NA  0.14  0.8930      0.24
 7: M2-M3 on Young  -0.06    NA -0.47  0.6541      0.07
 8:   M2-M3 on Old  -0.01    NA -0.06  0.9512      0.22
 9: M3-M4 on Young   0.06    NA  0.32  0.7594      0.15
10:   M3-M4 on Old   0.05    NA  0.35  0.7337      0.12

$DetallMainC
   Contr psihat  test p.value Psihat2 p.value2 EfSize.V1
1: M1-M2   0.03  0.31  0.7662   -0.13    0.312      0.18
2: M2-M3  -0.11 -0.46  0.6552    0.06    0.740      0.11
3: M3-M4   0.15  0.86  0.4132    0.13    0.504      0.11
Omnibus AOV Design 2x(4xS)
Names Q p pBoot Sig pBootMas Sig2 EffSize
Age 0.20 0.6613 0.7346 0.7246 0.07
Trial 0.48 0.7010 0.7479 0.7481 0.12
Age*Trial 0.23 0.8765 0.9299 0.9041 0.11
Simple Effects Age-Time Design 2x(4xS)
Contr psihat df test p.value EfSize.V1
Age on M1 0.03 19.82 0.37 0.7184 0.10
Age on M2 -0.04 20.00 -0.48 0.6355 0.13
Age on M3 0.07 13.25 0.63 0.5422 0.15
Age on M4 0.04 14.40 0.26 0.7969 0.07
M1-M2 on Young -0.02 NA -0.15 0.8870 0.10
M1-M2 on Old 0.02 NA 0.14 0.8930 0.24
M2-M3 on Young -0.06 NA -0.47 0.6541 0.07
M2-M3 on Old -0.01 NA -0.06 0.9512 0.22
M3-M4 on Young 0.06 NA 0.32 0.7594 0.15
M3-M4 on Old 0.05 NA 0.35 0.7337 0.12
Main Effects Time Design 2x(4xS)
Contr psihat test p.value Psihat2 p.value2 EfSize.V1
M1-M2 0.03 0.31 0.7662 -0.13 0.312 0.18
M2-M3 -0.11 -0.46 0.6552 0.06 0.740 0.11
M3-M4 0.15 0.86 0.4132 0.13 0.504 0.11

6 Figure 5. Sleep patterns during post-training and recovery sleep in young and old mice.


Figure 5. Sleep patterns during post-training and recovery sleep in young and old mice. A-C) Percentage of total time (A), number of bouts (B), and bout length (C) in Wake, NREM, and REM during post-training sleep in young and old control mice. D-F) Percentage of total time (D), number of bouts (E), and bout length (F) in Wake, NREM and REM during recovery sleep in control and SD groups. Young control (n=11), young SD (n=11), old control (n=8), old SD (n=10). Asterisks (*) represent significance using alpha=0.05. Statistical details in Supplemental Statistical Table corresponding to Figure 5.


  1. Percentage of total time in Wake, NREM, and REM during post-training sleep young-old control mice.
  2. Number of bouts in Wake, NREM, and REM during post-training
  3. Bout length in Wake, NREM, and REM during post-training sleep

6.1 Fig 5A,B,C Sleep Post Learning {Design 2 MANOVA}

  NmBas="Fig5A_B_C PostL"
  NmFich<-paste0(PathDesign,"PostLearn.csv");
  NmFAlL<-paste0(PathDesign,NmBas)
  
  if (!dir.exists(NmFAlL)) {dir.create(NmFAlL)}
  NmFAlL<-paste0(NmFAlL,"/")
  DatDT <- data.table(read.table(NmFich, header=TRUE, sep=";", na.strings="NA", dec=",",strip.white=TRUE))

  Nms<-names(DatDT)
  Final=ncol(DatDT)
  VarsS<-c(3:Final)
  NmsSel<-names(DatDT[,VarsS,with=F])
  
  DatDT$Factor<-factor(DatDT$Factor);levels(DatDT$Factor) <- list("Young"="YC", "Old"="OC")
  DatDT$Factor<-relevel(DatDT$Factor,"Young")
  setkeyv(DatDT,c("Factor")) 
  
  ResRo<-list(); rR<-list()
  
    for (i in 3:11) {
      ArP<-list()
    ArP<-c(lapply(1:2, function (x) na.omit(DatDT[.(levels(DatDT$Factor)[x]),i,with=F][[1]])),recursive = F)
    rR[[i-2]]<-AOVSingle(ArP,2)
    }
  #AOV
  rbResRb22<-data.table(NmsSel,do.call(rbind, lapply(rR, as.data.table)))
  
  #MANOVA  
  NwLst<-list()
    NwLst[[1]]<-DatDT[.("Young"),c(3:5),with=F]
    NwLst[[2]]<-DatDT[.("Old"),c(3:5),with=F]
    ResRo$MANOVA1<-MULAOVp(NwLst,2,3);  MULtr.anova(NwLst,2,3)
    NwLst[[1]]<-DatDT[.("Young"),c(6:8),with=F]
    NwLst[[2]]<-DatDT[.("Old"),c(6:8),with=F]
    MULAOVp(NwLst,2,3); MULtr.anova(NwLst,2,3)
    ResRo$MANOVA2<-MULAOVp(NwLst,2,3);  MULtr.anova(NwLst,2,3)
    NwLst[[1]]<-DatDT[.("Young"),c(9:11),with=F]
    NwLst[[2]]<-DatDT[.("Old"),c(9:11),with=F]
    MULAOVp(NwLst,2,3); MULtr.anova(NwLst,2,3)
    ResRo$MANOVA3<-MULAOVp(NwLst,2,3);  MULtr.anova(NwLst,2,3)
    
    write.csv2(rbResRb22,paste0(NmFAlL, NmBas,"AllOmnContr.csv"))
    ResMANOVA<-data.table(rbind(unlist(ResRo$MANOVA1),unlist(ResRo$MANOVA2),unlist(ResRo$MANOVA3)))
    write.csv2(cbind(c("N","Length","Porc"),ResMANOVA),paste0(NmFAlL,NmBas,"AllMANOVA.csv"))
    
# Graphs
# Fig.5A
    NmBas="Fig6A PostL"
    DatDTG<-DatDT[,c(1,2,9:11)]
  setnames(DatDTG, "Factor", "Age")

  DatDTG$Age<-factor(DatDTG$Age);DatDTG$Age<-relevel(DatDTG$Age,"Young")
    DatDTG$Subject<-factor(DatDTG$Subject)
    setkey(DatDTG,Age)
  
  VIntra=3:5
  NmIntra=names(DatDTG[,VIntra,with=F])
  ExtendDT<-reshape(DatDTG,direction = "long",varying = list(3:5),idvar = "Subject",
          timevar=c("Moment"),times=NmIntra)
  colnames(ExtendDT)[4] <- "DepVar"
  
  ExtendDT$Moment<-factor(ExtendDT$Moment)
  levels(ExtendDT$Moment) <- list("WAKE"="Porc_Wake", "NREM"="Porc_NREM","REM"="Porc_REM")
  ExtendDT$Age<-factor(ExtendDT$Age);ExtendDT$Age<-relevel(ExtendDT$Age,"Young")
  
  ExtendDTRel<-copy(ExtendDT)
  names(ExtendDTRel)[2]<-"Group"
  Grp<- Grph.3b(DatP = ExtendDTRel,"OPR",LblsP =c("Sleep Patterns", "","Percent Total Time"),ylmP =c(0,80),hLin = F,lvIp = 3,GrpSel = c(1,3))
  plot(Grp)
  
  png(paste0(NmFAlL,NmBas,"6A.png"),width = 1200, height = 1000)
  plot(Grp)
  dev.off()
  pdf(paste0(NmFAlL,NmBas,"6A.pdf"),family = "ArialMT")
  plot(Grp)
  dev.off() 
  
  
# Fig.5B
  NmBas="Fig6B PostL"
    DatDTG<-DatDT[,c(1:5)]
  setnames(DatDTG, "Factor", "Age")
  
  DatDTG$Age<-factor(DatDTG$Age);DatDTG$Age<-relevel(DatDTG$Age,"Young")
    DatDTG$Subject<-factor(DatDTG$Subject)
    setkey(DatDTG,Age)
  
  VIntra=3:5
  NmIntra=names(DatDTG[,VIntra,with=F])
  ExtendDT<-reshape(DatDTG,direction = "long",varying = list(3:5),idvar = "Subject",
          timevar=c("Moment"),times=NmIntra)
  colnames(ExtendDT)[4] <- "DepVar"
  
  
  ExtendDT$Moment<-factor(ExtendDT$Moment)
  levels(ExtendDT$Moment) <- list("WAKE"="N_Wake", "NREM"="N_NREM","REM"="N_REM")
  ExtendDT$Age<-factor(ExtendDT$Age);ExtendDT$Age<-relevel(ExtendDT$Age,"Young")
  
  ExtendDTRel<-copy(ExtendDT)
  names(ExtendDTRel)[2]<-"Group"
  Grp<- Grph.3b(DatP = ExtendDTRel,"OPR",LblsP =c("Sleep Patterns", "","Number of Bouts"),
                ylmP =c(0,200),hLin = F,lvIp = 3,GrpSel = c(1,3))
  plot(Grp)
  
  levBp<-seq(0.8, 6, by=0.34)
  Grp2<- Grp + geom_signif(annotation="*",
              y_position=180, xmin=levBp[4]  , xmax=levBp[5], 
              tip_length = c(0.45, 0.02),vjust=0.5,textsize=10)+
              geom_signif(annotation="*",
              y_position=105, xmin=levBp[7]  , xmax=levBp[8], 
              tip_length = c(0.35, 0.02),vjust=0.5,textsize=10)
  plot(Grp2)
  
  png(paste0(NmFAlL,NmBas,"6B.png"),width = 1200, height = 1000)
    plot(Grp)
  dev.off()
  pdf(paste0(NmFAlL,NmBas,"6B.pdf"),family = "ArialMT")
    plot(Grp)
  dev.off() 
  pdf(paste0(NmFAlL,NmBas,"6B_Asterisk.pdf"),family = "ArialMT")
    plot(Grp2)
  dev.off() 
  
# Fig.5C
  NmBas="Fig6C PostL"
    DatDTG<-DatDT[,c(1,2,6:8)]
  setnames(DatDTG, "Factor", "Age")
  
  DatDTG$Age<-factor(DatDTG$Age);DatDTG$Age<-relevel(DatDTG$Age,"Young")
    DatDTG$Subject<-factor(DatDTG$Subject)
    setkey(DatDTG,Age)
  
  VIntra=3:5
  NmIntra=names(DatDTG[,VIntra,with=F])
  ExtendDT<-reshape(DatDTG,direction = "long",varying = list(3:5),idvar = "Subject",
          timevar=c("Moment"),times=NmIntra)
  colnames(ExtendDT)[4] <- "DepVar"
  
  ExtendDT$Moment<-factor(ExtendDT$Moment)
  levels(ExtendDT$Moment) <- list("WAKE"="Length_Wake", "NREM"="Length_NREM","REM"="Length_REM")
  ExtendDT$Age<-factor(ExtendDT$Age);ExtendDT$Age<-relevel(ExtendDT$Age,"Young")
   
  ExtendDTRel<-copy(ExtendDT)
  names(ExtendDTRel)[2]<-"Group"
  Grp<- Grph.3b(DatP = ExtendDTRel,"OPR",LblsP =c("Sleep Patterns", "","Average Bout Length (s)"),
                ylmP =c(0,200),hLin = F,lvIp = 3,GrpSel = c(1,3))
  plot(Grp)
 
  levBp<-seq(0.8, 6, by=0.34)
  Grp2<- Grp + geom_signif(annotation="#",
              y_position=125, xmin=levBp[1]  , xmax=levBp[2], 
              tip_length = c(0.02, 0.20),vjust=0,textsize=10)+
              geom_signif(annotation="#",
              y_position=195, xmin=levBp[4]  , xmax=levBp[5], 
              tip_length = c(0.02, 0.25),vjust=0,textsize=10)
  plot(Grp2)
  
  png(paste0(NmFAlL,NmBas,"6C.png"),width = 1200, height = 1000)
    plot(Grp)
  dev.off()
  pdf(paste0(NmFAlL,NmBas,"6C.pdf"),family = "ArialMT")
    plot(Grp)
  dev.off() 
  pdf(paste0(NmFAlL,NmBas,"6C_Asterisk.pdf"),family = "ArialMT")
    plot(Grp2)
  dev.off()
  
  # Results
  rbResRb22
  Kbl3(rbResRb22, "Omnibus AOV. Design 2");cat("\n")
$test.stat
[1] 77.31751

$crit.value
[1] 13.37283

$test.stat
[1] 9.884484

$p.value
[1] 0.083

$test.stat
[1] 9.884484

$crit.value
[1] 12.06959

$test.stat
[1] 9.884484

$crit.value
[1] 12.06959

$test.stat
[1] 2.598445

$p.value
[1] 0.548

$test.stat
[1] 2.598445

$crit.value
[1] 12.17795

$test.stat
[1] 2.598445

$crit.value
[1] 12.17795

quartz_off_screen 
                2 
quartz_off_screen 
                2 
quartz_off_screen 
                2 
quartz_off_screen 
                2 
quartz_off_screen 
                2 
quartz_off_screen 
                2 
quartz_off_screen 
                2 
quartz_off_screen 
                2 
        NmsSel                                                          t
1:      N_Wake Diff = -26.33, V(6.75) = 1.37, Eff.Size = 0.74, p = 0.2146
2:      N_NREM Diff = -46.81, V(9.23) = 2.84, Eff.Size = 0.74, p = 0.0189
3:       N_REM Diff = -39.93, V(8.46) = 2.97, Eff.Size = 0.61, p = 0.0168
4: Length_Wake   Diff = 27.6, V(9.85) = 1.92, Eff.Size = 0.64, p = 0.0849
5: Length_NREM Diff = 43.11, V(10.97) = 2.09, Eff.Size = 0.66, p = 0.0607
6:  Length_REM  Diff = 9.52, V(10.54) = 1.01, Eff.Size = 0.31, p = 0.3368
7:   Porc_Wake  Diff = 6.91, V(10.33) = 0.91, Eff.Size = 0.32, p = 0.3853
8:   Porc_NREM Diff = -3.59, V(10.47) = 0.49, Eff.Size = 0.16, p = 0.6328
9:    Porc_REM Diff = -4.36, V(10.28) = 1.42, Eff.Size = 0.35, p = 0.1864
                                                             tRk1 t.2.Diff
1:    Diff = -26.33, Fw(1,13.48) = 1, Eff.Size = 0.74, p = 0.3357   -26.33
2:  Diff = -46.81, Fw(1,14.09) = 7.87, Eff.Size = 0.74, p = 0.014   -46.81
3: Diff = -39.93, Fw(1,14.98) = 3.76, Eff.Size = 0.61, p = 0.0717   -39.93
4:   Diff = 27.6, Fw(1,14.37) = 4.71, Eff.Size = 0.64, p = 0.0472    27.60
5:    Diff = 43.11, Fw(1,14.92) = 4.55, Eff.Size = 0.66, p = 0.05    43.11
6:    Diff = 9.52, Fw(1,14.35) = 1.12, Eff.Size = 0.31, p = 0.308     9.52
7:   Diff = 6.91, Fw(1,13.28) = 0.89, Eff.Size = 0.32, p = 0.3612     6.91
8:  Diff = -3.59, Fw(1,14.55) = 0.44, Eff.Size = 0.16, p = 0.5198    -3.59
9:   Diff = -4.36, Fw(1,14.82) = 1.4, Eff.Size = 0.35, p = 0.2547    -4.36
   t.2.DF t.2.FW t.2.Ef.Size  t.2.p tRk2.Diff tRk2.DF1 tRk2.DF2 tRk2.Fw
1:   6.75   1.37        0.74 0.2146    -26.33        1    13.48    1.00
2:   9.23   2.84        0.74 0.0189    -46.81        1    14.09    7.87
3:   8.46   2.97        0.61 0.0168    -39.93        1    14.98    3.76
4:   9.85   1.92        0.64 0.0849     27.60        1    14.37    4.71
5:  10.97   2.09        0.66 0.0607     43.11        1    14.92    4.55
6:  10.54   1.01        0.31 0.3368      9.52        1    14.35    1.12
7:  10.33   0.91        0.32 0.3853      6.91        1    13.28    0.89
8:  10.47   0.49        0.16 0.6328     -3.59        1    14.55    0.44
9:  10.28   1.42        0.35 0.1864     -4.36        1    14.82    1.40
   tRk2.Ef.Size tRk2.p
1:         0.74 0.3357
2:         0.74 0.0140
3:         0.61 0.0717
4:         0.64 0.0472
5:         0.66 0.0500
6:         0.31 0.3080
7:         0.32 0.3612
8:         0.16 0.5198
9:         0.35 0.2547
Omnibus AOV. Design 2
NmsSel t tRk1 t.2.Diff t.2.DF t.2.FW t.2.Ef.Size t.2.p tRk2.Diff tRk2.DF1 tRk2.DF2 tRk2.Fw tRk2.Ef.Size tRk2.p
N_Wake Diff = -26.33, V(6.75) = 1.37, Eff.Size = 0.74, p = 0.2146 Diff = -26.33, Fw(1,13.48) = 1, Eff.Size = 0.74, p = 0.3357 -26.33 6.75 1.37 0.74 0.2146 -26.33 1 13.48 1.00 0.74 0.3357
N_NREM Diff = -46.81, V(9.23) = 2.84, Eff.Size = 0.74, p = 0.0189 Diff = -46.81, Fw(1,14.09) = 7.87, Eff.Size = 0.74, p = 0.014 -46.81 9.23 2.84 0.74 0.0189 -46.81 1 14.09 7.87 0.74 0.0140
N_REM Diff = -39.93, V(8.46) = 2.97, Eff.Size = 0.61, p = 0.0168 Diff = -39.93, Fw(1,14.98) = 3.76, Eff.Size = 0.61, p = 0.0717 -39.93 8.46 2.97 0.61 0.0168 -39.93 1 14.98 3.76 0.61 0.0717
Length_Wake Diff = 27.6, V(9.85) = 1.92, Eff.Size = 0.64, p = 0.0849 Diff = 27.6, Fw(1,14.37) = 4.71, Eff.Size = 0.64, p = 0.0472 27.60 9.85 1.92 0.64 0.0849 27.60 1 14.37 4.71 0.64 0.0472
Length_NREM Diff = 43.11, V(10.97) = 2.09, Eff.Size = 0.66, p = 0.0607 Diff = 43.11, Fw(1,14.92) = 4.55, Eff.Size = 0.66, p = 0.05 43.11 10.97 2.09 0.66 0.0607 43.11 1 14.92 4.55 0.66 0.0500
Length_REM Diff = 9.52, V(10.54) = 1.01, Eff.Size = 0.31, p = 0.3368 Diff = 9.52, Fw(1,14.35) = 1.12, Eff.Size = 0.31, p = 0.308 9.52 10.54 1.01 0.31 0.3368 9.52 1 14.35 1.12 0.31 0.3080
Porc_Wake Diff = 6.91, V(10.33) = 0.91, Eff.Size = 0.32, p = 0.3853 Diff = 6.91, Fw(1,13.28) = 0.89, Eff.Size = 0.32, p = 0.3612 6.91 10.33 0.91 0.32 0.3853 6.91 1 13.28 0.89 0.32 0.3612
Porc_NREM Diff = -3.59, V(10.47) = 0.49, Eff.Size = 0.16, p = 0.6328 Diff = -3.59, Fw(1,14.55) = 0.44, Eff.Size = 0.16, p = 0.5198 -3.59 10.47 0.49 0.16 0.6328 -3.59 1 14.55 0.44 0.16 0.5198
Porc_REM Diff = -4.36, V(10.28) = 1.42, Eff.Size = 0.35, p = 0.1864 Diff = -4.36, Fw(1,14.82) = 1.4, Eff.Size = 0.35, p = 0.2547 -4.36 10.28 1.42 0.35 0.1864 -4.36 1 14.82 1.40 0.35 0.2547

  1. Percentage of total time in Wake, NREM and REM during recovery sleep control-SR group
  2. Number of bouts in Wake, NREM and REM during recovery sleep
  3. bout length in Wake, NREM and REM during recovery sleep

6.2 Fig 5D,E,F Sleep Recovery {2x2 MANOVA}

  NmBas="Fig6D_E_F Recovery"
  NmFich<-paste0(PathDesign,"RecoverSleep.csv");
  NmFAlL<-paste0(PathDesign,NmBas)
  if (!dir.exists(NmFAlL)) {dir.create(NmFAlL)}
  NmFAlL<-paste0(NmFAlL,"/")
  DatDT <- data.table(read.table(NmFich, header=TRUE, sep=";", na.strings="NA", dec=",",strip.white=TRUE))

  Nms<-names(DatDT)
  Final=ncol(DatDT)
  VarsS<-c(4:Final)
  NmsSel<-names(DatDT[,VarsS,with=F])
  
  setnames(DatDT, "FactorA", "Age")
  setnames(DatDT, "FactorB", "Sleep")
  setnames(DatDT, "subject", "Subject")
  
  DatDT$Age<-factor(DatDT$Age);levels(DatDT$Age) <- list("Young"="y", "Old"="O")
  DatDT$Age<-relevel(DatDT$Age,"Young")
  DatDT$Sleep<-factor(DatDT$Sleep);levels(DatDT$Sleep) <- list("Control"="C", "SR"="SD")
  DatDT$Sleep<-relevel(DatDT$Sleep,"Control")
    DatDT$Subject<-factor(DatDT$Subject)
    setkey(DatDT,Age,Sleep)
  
    ResRo<-list()
    ResRo2AOV<-ResRo2Detall<-ResRo2DetallExt<-list()
    i=4
    for (i in 4:12) {
      rrt<-list()
      VarSel<-c(2,3,i)
      rrt$DT<-DatDT[,..VarSel]
      ArP<-unlist(lapply(1:2, function (x) lapply(1:2, function(y) DatDT[.(levels(DatDT$Age)[x],levels(DatDT$Sleep)[y]),i,with=F][[1]])),recursive = F)
      rrt$ArP<-ArP
      names(rrt$DT)[3]<-"DepV"
    ResRo2<-AOVBwF(2,2,DatPas = rrt,nBMM = 1000)
    
    ResRo2AOV[[i-3]]<-ResRo2$AOV
    ResRo2Detall[[i-3]]<-ResRo2$Detall
    ResRo2DetallExt[[i-3]]<-ResRo2$DetallExt
    }
    
      rbResRb23AOV<-data.table(NmsSel,do.call(rbind, lapply(ResRo2AOV, as.data.table)))
      rbResRb23Detall<-data.table(NmsSel,do.call(rbind, lapply(ResRo2Detall, as.data.table)))
      rbResRb23DetallExt<-data.table(NmsSel,do.call(rbind, lapply(ResRo2DetallExt, as.data.table)))
    
        write.csv2(rbResRb23AOV,paste0(NmFAlL,NmBas,"AllAOV.csv"))
        write.csv2(rbResRb23Detall,paste0(NmFAlL,NmBas,"AllDetallContr.csv"))
        write.csv2(rbResRb23DetallExt,paste0(NmFAlL,NmBas,"AllDetallExtContr.csv"))
    
# Graphs
# Fig.5D
    NmBas="Fig6D Recovery"
    DatDTG<-DatDT[,c(1,2,3,10:12)]
  
  VIntra=4:6
  NmIntra=names(DatDTG[,VIntra,with=F])
  ExtendDT<-reshape(DatDTG,direction = "long",varying = list(4:6),idvar = "Subject",
          timevar=c("Moment"),times=NmIntra)
  colnames(ExtendDT)[5] <- "DepVar"
  
  ExtendDT$Moment<-factor(ExtendDT$Moment)
  levels(ExtendDT$Moment) <- list("WAKE"="Porc_Wake", "NREM"="Porc_NREM","REM"="Porc_REM")
  ExtendDT$Age<-factor(ExtendDT$Age);ExtendDT$Age<-relevel(ExtendDT$Age,"Young")
  ExtendDT$Sleep<-factor(ExtendDT$Sleep);ExtendDT$Sleep<-relevel(ExtendDT$Sleep,"Control")
  ExtendDT$Inter<-interaction(ExtendDT$Age,ExtendDT$Sleep)
  ExtendDT$Inter<-factor( ExtendDT$Inter,levels=c("Young.Control", "Young.SR", "Old.Control","Old.SR"))
  
  Grp<- Grph.3(DatP = ExtendDT,"OPR",LblsP =c("Sleep Patterns", "","Percent Total Time"),ylmP =c(0,80),hLin = F,lvIp = 3)
  plot(Grp)
  
  levBp<-seq(0.7, 5, by=0.2)
  Grp2<- Grp + geom_signif(annotation=c("","","*"),
              y_position=c(75,77,79),
              xmin=c(levBp[1+5],levBp[2+5], mean(levBp[c(1+5,2+5)])),
              xmax=c(levBp[3+5],levBp[4+5], mean(levBp[c(2+5,4+5)])), 
              tip_length = c(c(0.02, 0.02),c(0.02, 0.02),c(0.05, 0.02)),vjust=0.5,textsize=10)
  
  plot(Grp2)
  
  png(paste0(NmFAlL,NmBas,"6D.png"),width = 1200, height = 1000)
    plot(Grp)
  dev.off()
  pdf(paste0(NmFAlL,NmBas,"6D.pdf"),family = "ArialMT")
    plot(Grp)
  dev.off() 
  pdf(paste0(NmFAlL,NmBas,"6D_Asterisk.pdf"),family = "ArialMT")
    plot(Grp2)
  dev.off() 
   
  
# Fig.5E
  NmBas="Fig6E Recovery"
    DatDTG<-DatDT[,c(1,2,3,4:6)]
  
  VIntra=4:6
  NmIntra=names(DatDTG[,VIntra,with=F])
  ExtendDT<-reshape(DatDTG,direction = "long",varying = list(4:6),idvar = "Subject",
          timevar=c("Moment"),times=NmIntra)
  colnames(ExtendDT)[5] <- "DepVar"
  
  ExtendDT$Moment<-factor(ExtendDT$Moment)
  levels(ExtendDT$Moment) <- list("WAKE"="N_Wake", "NREM"="N_NREM","REM"="N_REM")
  ExtendDT$Age<-factor(ExtendDT$Age);ExtendDT$Age<-relevel(ExtendDT$Age,"Young")
  ExtendDT$Sleep<-factor(ExtendDT$Sleep);ExtendDT$Sleep<-relevel(ExtendDT$Sleep,"Control")
  ExtendDT$Inter<-interaction(ExtendDT$Age,ExtendDT$Sleep)
  ExtendDT$Inter<-factor( ExtendDT$Inter,levels=c("Young.Control", "Young.SR", "Old.Control","Old.SR"))
  
  Grp<- Grph.3(DatP = ExtendDT,"OPR",LblsP =c("Sleep Patterns", "","Number of Bouts"),ylmP =c(0,200),hLin = F,lvIp = 3)
  plot(Grp)
  
  levBp<-seq(0.7, 5, by=0.2)
  Grp2<- Grp + geom_signif(annotation="*",
              y_position=195, xmin=levBp[3+5]  , xmax=levBp[4+5], 
              tip_length = c(0.02, 0.02),vjust=0.5,textsize=10) +
    geom_signif(annotation="#",
              y_position=180, xmin=levBp[2+5]  , xmax=levBp[4+5], 
              tip_length = c(0.02, 0.02),vjust=0,textsize=8)
  
  plot(Grp2)
  
  png(paste0(NmFAlL,NmBas,"6D.png"),width = 1200, height = 1000)
    plot(Grp)
  dev.off()
  pdf(paste0(NmFAlL,NmBas,"6D.pdf"),family = "ArialMT")
    plot(Grp)
  dev.off() 
  pdf(paste0(NmFAlL,NmBas,"6D_Asterisk.pdf"),family = "ArialMT")
    plot(Grp2)
  dev.off()
  
# Fig.5F
  NmBas="Fig6F Recovery"
    DatDTG<-DatDT[,c(1,2,3,7:9)]
  
  VIntra=4:6
  NmIntra=names(DatDTG[,VIntra,with=F])
  ExtendDT<-reshape(DatDTG,direction = "long",varying = list(4:6),idvar = "Subject",
          timevar=c("Moment"),times=NmIntra)
  colnames(ExtendDT)[5] <- "DepVar"
  
  ExtendDT$Moment<-factor(ExtendDT$Moment)
  levels(ExtendDT$Moment) <- list("WAKE"="Length_Wake", "NREM"="Length_NREM","REM"="Length_REM")
  ExtendDT$Age<-factor(ExtendDT$Age);ExtendDT$Age<-relevel(ExtendDT$Age,"Young")
  ExtendDT$Sleep<-factor(ExtendDT$Sleep);ExtendDT$Sleep<-relevel(ExtendDT$Sleep,"Control")
  ExtendDT$Inter<-interaction(ExtendDT$Age,ExtendDT$Sleep)
  ExtendDT$Inter<-factor( ExtendDT$Inter,levels=c("Young.Control", "Young.SR", "Old.Control","Old.SR"))
  
  Grp<- Grph.3(DatP = ExtendDT,"OPR",LblsP =c("Sleep Patterns", "","Average Bout Length (s)"),ylmP =c(0,200),hLin = F,lvIp = 3)
  plot(Grp)
  
  levBp<-seq(0.7, 5, by=0.2)
  Grp2<- Grp + geom_signif(annotation=c("","","*"),
              y_position=c(185,195,200),
              xmin=c(levBp[1+5],levBp[2+5], mean(levBp[c(1+5,2+5)])),
              xmax=c(levBp[3+5],levBp[4+5], mean(levBp[c(2+5,4+5)])), 
              tip_length = c(c(0.10, 0.10),c(0.02, 0.02),c(0.05, 0.02)),vjust=0.5,textsize=10)
  plot(Grp2)
  
  png(paste0(NmFAlL,NmBas,"6D.png"),width = 1200, height = 1000)
    plot(Grp)
  dev.off()
  pdf(paste0(NmFAlL,NmBas,"6D.pdf"),family = "ArialMT")
    plot(Grp)
  dev.off() 
  pdf(paste0(NmFAlL,NmBas,"6D_Asterisk.pdf"),family = "ArialMT")
    plot(Grp2)
  dev.off()
  
  # Results
  rbResRb23AOV    #Omnibus AOV. Design 2x2"
  rbResRb23Detall #Simple Effects Age-Sleep. Design 2x2
    rbResRb23DetallExt # Extense Simple Effects Age-Sleep. Design 2x2
    
    Kbl3(rbResRb23AOV, "Omnibus AOV. Design 2x2");cat("\n")
  Kbl3(rbResRb23Detall, "Simple Effects Age-Sleep. Design 2x2")
  Kbl3(rbResRb23DetallExt, "Extense Simple Effects Age-Sleep. Design 2x2")
[1] "Taking bootstrap samples. Please wait."
          Eff   p.V1 p.Sig
1:  A.p.value 0.2922      
2:  B.p.value 0.1870      
3: AB.p.value     NA      
[1] "Taking bootstrap samples. Please wait."
          Eff  p.V1 p.Sig
1:  A.p.value 0.269      
2:  B.p.value 0.170      
3: AB.p.value 0.986      
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Taking bootstrap samples. Please wait."
          Eff   p.V1 p.Sig
1:  A.p.value 0.2755      
2:  B.p.value 0.0467 *    
3: AB.p.value 0.4992      
[1] "Taking bootstrap samples. Please wait."
          Eff  p.V1 p.Sig
1:  A.p.value 0.294      
2:  B.p.value 0.039 *    
3: AB.p.value 0.567      
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Taking bootstrap samples. Please wait."
          Eff   p.V1 p.Sig
1:  A.p.value 0.5409      
2:  B.p.value 0.8798      
3: AB.p.value     NA      
[1] "Taking bootstrap samples. Please wait."
          Eff  p.V1 p.Sig
1:  A.p.value 0.517      
2:  B.p.value 0.885      
3: AB.p.value 0.149      
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Taking bootstrap samples. Please wait."
          Eff   p.V1 p.Sig
1:  A.p.value 0.5492      
2:  B.p.value 0.9316      
3: AB.p.value     NA      
[1] "Taking bootstrap samples. Please wait."
          Eff  p.V1 p.Sig
1:  A.p.value 0.519      
2:  B.p.value 0.900      
3: AB.p.value 0.678      
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Taking bootstrap samples. Please wait."
          Eff   p.V1 p.Sig
1:  A.p.value 0.6678      
2:  B.p.value 0.0200 *    
3: AB.p.value 0.4524      
[1] "Taking bootstrap samples. Please wait."
          Eff  p.V1 p.Sig
1:  A.p.value 0.721      
2:  B.p.value 0.013 *    
3: AB.p.value 0.989      
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Taking bootstrap samples. Please wait."
          Eff   p.V1 p.Sig
1:  A.p.value 0.2705      
2:  B.p.value 0.0467 *    
3: AB.p.value 0.1302      
[1] "Taking bootstrap samples. Please wait."
          Eff  p.V1 p.Sig
1:  A.p.value 0.253      
2:  B.p.value 0.038 *    
3: AB.p.value 0.079      
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Taking bootstrap samples. Please wait."
          Eff   p.V1 p.Sig
1:  A.p.value 0.5526      
2:  B.p.value 0.0952      
3: AB.p.value 0.9065      
[1] "Taking bootstrap samples. Please wait."
          Eff  p.V1 p.Sig
1:  A.p.value 0.587      
2:  B.p.value 0.116      
3: AB.p.value 0.775      
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Taking bootstrap samples. Please wait."
          Eff   p.V1 p.Sig
1:  A.p.value 0.7696      
2:  B.p.value 0.0401 *    
3: AB.p.value 0.5760      
[1] "Taking bootstrap samples. Please wait."
          Eff  p.V1 p.Sig
1:  A.p.value 0.741      
2:  B.p.value 0.037 *    
3: AB.p.value 0.647      
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Taking bootstrap samples. Please wait."
          Eff   p.V1 p.Sig
1:  A.p.value 0.4107      
2:  B.p.value 0.3656      
3: AB.p.value 0.8781      
[1] "Taking bootstrap samples. Please wait."
          Eff  p.V1 p.Sig
1:  A.p.value 0.352      
2:  B.p.value 0.377      
3: AB.p.value 0.794      
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
quartz_off_screen 
                2 
quartz_off_screen 
                2 
quartz_off_screen 
                2 
quartz_off_screen 
                2 
quartz_off_screen 
                2 
quartz_off_screen 
                2 
quartz_off_screen 
                2 
quartz_off_screen 
                2 
quartz_off_screen 
                2 
         NmsSel     Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot   Sig
 1:      N_Wake       Age 1.22 0.283   1.22  0.283  1.19 0.2830 0.2922      
 2:      N_NREM     Sleep 1.99 0.175   1.99  0.175  1.34 0.2558 0.1870      
 3:       N_REM Age*Sleep 0.00 0.988  -0.04  0.820  0.00 0.9524     NA      
 4: Length_Wake       Age 1.06 0.321   1.06  0.321  2.69 0.1105 0.2755      
 5: Length_NREM     Sleep 5.33 0.035   5.33  0.035 11.47 0.0019 0.0467 *    
 6:  Length_REM Age*Sleep 0.30 0.595   0.32  0.030  2.66 0.1128 0.4992      
 7:   Porc_Wake       Age 0.40 0.538   0.40  0.538  0.36 0.5547 0.5409      
 8:   Porc_NREM     Sleep 0.02 0.884   0.02  0.884  0.12 0.7270 0.8798      
 9:    Porc_REM Age*Sleep 2.26 0.149  -0.36  0.050  3.66 0.0649     NA      
10:      N_Wake       Age 0.40 0.535   0.40  0.535  0.13 0.7250 0.5492      
11:      N_NREM     Sleep 0.02 0.899   0.02  0.899  0.01 0.9115 0.9316      
12:       N_REM Age*Sleep 0.20 0.663   0.01  0.970  0.02 0.8929     NA      
13: Length_Wake       Age 0.16 0.690   0.16  0.690  0.30 0.5877 0.6678      
14: Length_NREM     Sleep 7.53 0.013   7.53  0.013 10.44 0.0028 0.0200 *    
15:  Length_REM Age*Sleep 0.00 0.983  -0.06  0.730  0.22 0.6441 0.4524      
16:   Porc_Wake       Age 1.36 0.258   1.36  0.258  0.99 0.3283 0.2705      
17:   Porc_NREM     Sleep 4.19 0.054   4.19  0.054  3.12 0.0886 0.0467 *    
18:    Porc_REM Age*Sleep 3.21 0.089   0.34  0.060  3.41 0.0758 0.1302      
19:      N_Wake       Age 0.33 0.574   0.33  0.574  0.35 0.5573 0.5526      
20:      N_NREM     Sleep 3.02 0.099   3.02  0.099  3.62 0.0653 0.0952      
21:       N_REM Age*Sleep 0.08 0.777   0.03  0.850  0.03 0.8532 0.9065      
22: Length_Wake       Age 0.09 0.765   0.09  0.765  0.00 0.9862 0.7696      
23: Length_NREM     Sleep 4.65 0.048   4.65  0.048  7.73 0.0087 0.0401 *    
24:  Length_REM Age*Sleep 0.23 0.638  -0.06  0.740  0.02 0.8766 0.5760      
25:   Porc_Wake       Age 0.84 0.369   0.84  0.369  1.21 0.2785 0.4107      
26:   Porc_NREM     Sleep 0.76 0.392   0.76  0.392  1.00 0.3241 0.3656      
27:    Porc_REM Age*Sleep 0.09 0.771  -0.08  0.690  0.30 0.5855 0.8781      
         NmsSel     Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot   Sig
    pBootMas SigMas EffSize
 1:    0.269           0.20
 2:    0.170           0.24
 3:    0.986           0.03
 4:    0.294           0.39
 5:    0.039  *        0.54
 6:    0.567           0.30
 7:    0.517           0.16
 8:    0.885           0.07
 9:    0.149           0.60
10:    0.519           0.14
11:    0.900           0.06
12:    0.678           0.10
13:    0.721           0.25
14:    0.013  *        0.62
15:    0.989           0.09
16:    0.253           0.27
17:    0.038  *        0.43
18:    0.079           0.57
19:    0.587           0.07
20:    0.116           0.42
21:    0.775           0.09
22:    0.741           0.05
23:    0.037  *        0.36
24:    0.647           0.07
25:    0.352           0.23
26:    0.377           0.16
27:    0.794           0.17
    pBootMas SigMas EffSize
         NmsSel          Contr psihat    df  test p.value EfSize.V1 Test.Boot
 1:      N_Wake Sleep on Young  19.57  9.92  1.20  0.2581      0.32      1.44
 2:      N_NREM   Sleep on Old  20.00  9.80  0.88  0.4019      0.18      0.77
 3:       N_REM Age on Control -15.74 10.07 -0.71  0.4940      0.21      0.50
 4: Length_Wake      Age on SR -15.31  8.05 -0.89  0.3989      0.25      0.79
 5: Length_NREM Sleep on Young  23.71  8.88  1.03  0.3281      0.30      1.07
 6:  Length_REM   Sleep on Old  38.33  5.66  2.73  0.0361      0.80      7.48
 7:   Porc_Wake Age on Control   6.50 10.10  0.26  0.7965      0.17      0.07
 8:   Porc_NREM      Age on SR  21.12  7.33  1.94  0.0923      0.59      3.75
 9:    Porc_REM Sleep on Young  16.86  9.56  1.41  0.1911      0.52      1.98
10:      N_Wake   Sleep on Old -13.83  9.83 -0.84  0.4221      0.32      0.70
11:      N_NREM Age on Control   8.93 10.79  0.59  0.5653      0.24      0.35
12:       N_REM      Age on SR -21.76  7.25 -1.58  0.1566      0.59      2.50
13: Length_Wake Sleep on Young  -4.32 10.03 -0.18  0.8586      0.07      0.03
14: Length_NREM   Sleep on Old   7.88  9.97  0.57  0.5832      0.10      0.32
15:  Length_REM Age on Control   2.59 10.84  0.16  0.8747      0.13      0.03
16:   Porc_Wake      Age on SR  14.79  8.50  0.66  0.5239      0.29      0.44
17:   Porc_NREM Sleep on Young -45.20 11.98 -1.86  0.0873      0.53      3.47
18:    Porc_REM   Sleep on Old -45.92  7.26 -2.03  0.0809      0.91      4.10
19:      N_Wake Age on Control  -6.38 10.21 -0.24  0.8142      0.09      0.06
20:      N_NREM      Age on SR  -7.10  9.35 -0.35  0.7320      0.11      0.12
21:       N_REM Sleep on Young -12.54 10.25 -2.67  0.0232      0.67      7.11
22: Length_Wake   Sleep on Old  -0.84  8.71 -0.19  0.8572      0.12      0.03
23: Length_NREM Age on Control  -2.04  9.03 -0.45  0.6653      0.12      0.20
24:  Length_REM      Age on SR   9.66  9.89  2.06  0.0665      0.60      4.25
25:   Porc_Wake Sleep on Young   3.91 10.73  1.14  0.2788      0.32      1.30
26:   Porc_NREM   Sleep on Old   5.46  8.20  1.31  0.2247      0.61      1.72
27:    Porc_REM Age on Control  -2.32  9.95 -0.51  0.6198      0.16      0.26
28:      N_Wake      Age on SR  -0.77 10.66 -0.27  0.7957      0.09      0.07
29:      N_NREM Sleep on Young  -5.73 12.00 -1.54  0.1490      0.42      2.38
30:       N_REM   Sleep on Old  -9.04  7.57 -1.57  0.1568      0.39      2.47
31: Length_Wake Age on Control   2.70  7.55  0.47  0.6506      0.18      0.22
32: Length_NREM      Age on SR  -0.60 10.88 -0.16  0.8752      0.08      0.03
33:  Length_REM Sleep on Young   1.76 11.99  0.78  0.4479      0.24      0.62
34:   Porc_Wake   Sleep on Old   0.87  9.56  0.43  0.6746      0.12      0.19
35:   Porc_NREM Age on Control   1.82 10.91  0.82  0.4277      0.29      0.68
36:    Porc_REM      Age on SR   0.94 10.77  0.46  0.6548      0.14      0.21
         NmsSel          Contr psihat    df  test p.value EfSize.V1 Test.Boot
    p.Boot EffSize.Boot
 1: 0.2378         0.32
 2: 0.3967         0.17
 3: 0.4711         0.19
 4: 0.4267         0.25
 5: 0.2903         0.30
 6: 0.0689         0.81
 7: 0.7944         0.18
 8: 0.0912         0.62
 9: 0.2089         0.52
10: 0.4388         0.32
11: 0.5833         0.25
12: 0.1459         0.59
13: 0.8711         0.07
14: 0.5933         0.10
15: 0.8687         0.15
16: 0.5322         0.26
17: 0.0956         0.53
18: 0.0978         0.90
19: 0.7989         0.09
20: 0.7267         0.06
21: 0.0256         0.67
22: 0.8598         0.09
23: 0.6711         0.12
24: 0.0700         0.65
25: 0.2511         0.32
26: 0.2436         0.60
27: 0.5989         0.17
28: 0.8040         0.09
29: 0.1122         0.42
30: 0.1581         0.40
31: 0.6578         0.18
32: 0.8665         0.08
33: 0.4467         0.24
34: 0.6600         0.13
35: 0.4200         0.28
36: 0.6578         0.13
    p.Boot EffSize.Boot
         NmsSel          Contr psihat    df  test p.value EfSize.V1 Test.Boot
 1:      N_Wake Sleep on Young  19.57  9.92  1.20  0.2581      0.32      1.44
 2:      N_NREM   Sleep on Old  20.00  9.80  0.88  0.4019      0.17      0.77
 3:       N_REM Age on Control -15.74 10.07 -0.71  0.4940      0.19      0.50
 4: Length_Wake      Age on SR -15.31  8.05 -0.89  0.3989      0.25      0.79
 5: Length_NREM      YSR vs OC -35.31  7.36 -1.84  0.1070      0.41      3.37
 6:  Length_REM Sleep on Young  23.71  8.88  1.03  0.3281      0.30      1.07
 7:   Porc_Wake   Sleep on Old  38.33  5.66  2.73  0.0361      0.81      7.48
 8:   Porc_NREM Age on Control   6.50 10.10  0.26  0.7965      0.18      0.07
 9:    Porc_REM      Age on SR  21.12  7.33  1.94  0.0923      0.59      3.75
10:      N_Wake      YSR vs OC -17.21  9.75 -1.01  0.3375      0.23      1.02
11:      N_NREM Sleep on Young  16.86  9.56  1.41  0.1911      0.52      1.98
12:       N_REM   Sleep on Old -13.83  9.83 -0.84  0.4221      0.32      0.70
13: Length_Wake Age on Control   8.93 10.79  0.59  0.5653      0.22      0.35
14: Length_NREM      Age on SR -21.76  7.25 -1.58  0.1566      0.59      2.50
15:  Length_REM      YSR vs OC  -7.93  7.86 -0.64  0.5412      0.23      0.41
16:   Porc_Wake Sleep on Young  -4.32 10.03 -0.18  0.8586      0.07      0.03
17:   Porc_NREM   Sleep on Old   7.88  9.97  0.57  0.5832      0.10      0.32
18:    Porc_REM Age on Control   2.59 10.84  0.16  0.8747      0.12      0.03
19:      N_Wake      Age on SR  14.79  8.50  0.66  0.5239      0.29      0.44
20:      N_NREM      YSR vs OC   6.91  8.74  0.31  0.7657      0.22      0.09
21:       N_REM Sleep on Young -45.20 11.98 -1.86  0.0873      0.53      3.47
22: Length_Wake   Sleep on Old -45.92  7.26 -2.03  0.0809      0.91      4.10
23: Length_NREM Age on Control  -6.38 10.21 -0.24  0.8142      0.09      0.06
24:  Length_REM      Age on SR  -7.10  9.35 -0.35  0.7320      0.19      0.12
25:   Porc_Wake      YSR vs OC  38.83 10.38  1.45  0.1774      0.52      2.09
26:   Porc_NREM Sleep on Young -12.54 10.25 -2.67  0.0232      0.67      7.11
27:    Porc_REM   Sleep on Old  -0.84  8.71 -0.19  0.8572      0.11      0.03
28:      N_Wake Age on Control  -2.04  9.03 -0.45  0.6653      0.11      0.20
29:      N_NREM      Age on SR   9.66  9.89  2.06  0.0665      0.65      4.25
30:       N_REM      YSR vs OC  10.50 10.98  1.92  0.0810      0.56      3.69
31: Length_Wake Sleep on Young   3.91 10.73  1.14  0.2788      0.32      1.30
32: Length_NREM   Sleep on Old   5.46  8.20  1.31  0.2247      0.61      1.72
33:  Length_REM Age on Control  -2.32  9.95 -0.51  0.6198      0.13      0.26
34:   Porc_Wake      Age on SR  -0.77 10.66 -0.27  0.7957      0.09      0.07
35:   Porc_NREM      YSR vs OC  -6.23  7.89 -1.53  0.1646      0.62      2.35
36:    Porc_REM Sleep on Young  -5.73 12.00 -1.54  0.1490      0.42      2.38
37:      N_Wake   Sleep on Old  -9.04  7.57 -1.57  0.1568      0.39      2.47
38:      N_NREM Age on Control   2.70  7.55  0.47  0.6506      0.18      0.22
39:       N_REM      Age on SR  -0.60 10.88 -0.16  0.8752      0.08      0.03
40: Length_Wake      YSR vs OC   8.43  7.60  1.47  0.1816      0.39      2.16
41: Length_NREM Sleep on Young   1.76 11.99  0.78  0.4479      0.24      0.62
42:  Length_REM   Sleep on Old   0.87  9.56  0.43  0.6746      0.13      0.19
43:   Porc_Wake Age on Control   1.82 10.91  0.82  0.4277      0.32      0.68
44:   Porc_NREM      Age on SR   0.94 10.77  0.46  0.6548      0.13      0.21
45:    Porc_REM      YSR vs OC   0.07 10.95  0.03  0.9768      0.09      0.00
         NmsSel          Contr psihat    df  test p.value EfSize.V1 Test.Boot
    p.Boot EffSize.Boot
 1: 0.2222         0.32
 2: 0.4067         0.27
 3: 0.5000         0.20
 4: 0.4211         0.25
 5: 0.1123         0.42
 6: 0.3389         0.30
 7: 0.0678         0.80
 8: 0.7989         0.17
 9: 0.1011         0.58
10: 0.3593         0.22
11: 0.1889         0.52
12: 0.4131         0.37
13: 0.5511         0.25
14: 0.1550         0.59
15: 0.5484         0.20
16: 0.8867         0.07
17: 0.5913         0.10
18: 0.9011         0.13
19: 0.5478         0.31
20: 0.7887         0.30
21: 0.0856         0.53
22: 0.0989         0.90
23: 0.8156         0.09
24: 0.7033         0.19
25: 0.1947         0.52
26: 0.0200         0.67
27: 0.8654         0.12
28: 0.6711         0.11
29: 0.0857         0.60
30: 0.0723         0.58
31: 0.2836         0.32
32: 0.2581         0.61
33: 0.6133         0.18
34: 0.8328         0.09
35: 0.1735         0.64
36: 0.1300         0.42
37: 0.1419         0.40
38: 0.6730         0.17
39: 0.8929         0.08
40: 0.1846         0.39
41: 0.4244         0.24
42: 0.6585         0.11
43: 0.4300         0.30
44: 0.6622         0.13
45: 0.9744         0.11
    p.Boot EffSize.Boot
Omnibus AOV. Design 2x2
NmsSel Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
N_Wake Age 1.22 0.283 1.22 0.283 1.19 0.2830 0.2922 0.269 0.20
N_NREM Sleep 1.99 0.175 1.99 0.175 1.34 0.2558 0.1870 0.170 0.24
N_REM Age*Sleep 0.00 0.988 -0.04 0.820 0.00 0.9524 NA 0.986 0.03
Length_Wake Age 1.06 0.321 1.06 0.321 2.69 0.1105 0.2755 0.294 0.39
Length_NREM Sleep 5.33 0.035 5.33 0.035 11.47 0.0019 0.0467
0.039
0.54
Length_REM Age*Sleep 0.30 0.595 0.32 0.030 2.66 0.1128 0.4992 0.567 0.30
Porc_Wake Age 0.40 0.538 0.40 0.538 0.36 0.5547 0.5409 0.517 0.16
Porc_NREM Sleep 0.02 0.884 0.02 0.884 0.12 0.7270 0.8798 0.885 0.07
Porc_REM Age*Sleep 2.26 0.149 -0.36 0.050 3.66 0.0649 NA 0.149 0.60
N_Wake Age 0.40 0.535 0.40 0.535 0.13 0.7250 0.5492 0.519 0.14
N_NREM Sleep 0.02 0.899 0.02 0.899 0.01 0.9115 0.9316 0.900 0.06
N_REM Age*Sleep 0.20 0.663 0.01 0.970 0.02 0.8929 NA 0.678 0.10
Length_Wake Age 0.16 0.690 0.16 0.690 0.30 0.5877 0.6678 0.721 0.25
Length_NREM Sleep 7.53 0.013 7.53 0.013 10.44 0.0028 0.0200
0.013
0.62
Length_REM Age*Sleep 0.00 0.983 -0.06 0.730 0.22 0.6441 0.4524 0.989 0.09
Porc_Wake Age 1.36 0.258 1.36 0.258 0.99 0.3283 0.2705 0.253 0.27
Porc_NREM Sleep 4.19 0.054 4.19 0.054 3.12 0.0886 0.0467
0.038
0.43
Porc_REM Age*Sleep 3.21 0.089 0.34 0.060 3.41 0.0758 0.1302 0.079 0.57
N_Wake Age 0.33 0.574 0.33 0.574 0.35 0.5573 0.5526 0.587 0.07
N_NREM Sleep 3.02 0.099 3.02 0.099 3.62 0.0653 0.0952 0.116 0.42
N_REM Age*Sleep 0.08 0.777 0.03 0.850 0.03 0.8532 0.9065 0.775 0.09
Length_Wake Age 0.09 0.765 0.09 0.765 0.00 0.9862 0.7696 0.741 0.05
Length_NREM Sleep 4.65 0.048 4.65 0.048 7.73 0.0087 0.0401
0.037
0.36
Length_REM Age*Sleep 0.23 0.638 -0.06 0.740 0.02 0.8766 0.5760 0.647 0.07
Porc_Wake Age 0.84 0.369 0.84 0.369 1.21 0.2785 0.4107 0.352 0.23
Porc_NREM Sleep 0.76 0.392 0.76 0.392 1.00 0.3241 0.3656 0.377 0.16
Porc_REM Age*Sleep 0.09 0.771 -0.08 0.690 0.30 0.5855 0.8781 0.794 0.17
Simple Effects Age-Sleep. Design 2x2
NmsSel Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
N_Wake Sleep on Young 19.57 9.92 1.20 0.2581 0.32 1.44 0.2378 0.32
N_NREM Sleep on Old 20.00 9.80 0.88 0.4019 0.18 0.77 0.3967 0.17
N_REM Age on Control -15.74 10.07 -0.71 0.4940 0.21 0.50 0.4711 0.19
Length_Wake Age on SR -15.31 8.05 -0.89 0.3989 0.25 0.79 0.4267 0.25
Length_NREM Sleep on Young 23.71 8.88 1.03 0.3281 0.30 1.07 0.2903 0.30
Length_REM Sleep on Old 38.33 5.66 2.73 0.0361 0.80 7.48 0.0689 0.81
Porc_Wake Age on Control 6.50 10.10 0.26 0.7965 0.17 0.07 0.7944 0.18
Porc_NREM Age on SR 21.12 7.33 1.94 0.0923 0.59 3.75 0.0912 0.62
Porc_REM Sleep on Young 16.86 9.56 1.41 0.1911 0.52 1.98 0.2089 0.52
N_Wake Sleep on Old -13.83 9.83 -0.84 0.4221 0.32 0.70 0.4388 0.32
N_NREM Age on Control 8.93 10.79 0.59 0.5653 0.24 0.35 0.5833 0.25
N_REM Age on SR -21.76 7.25 -1.58 0.1566 0.59 2.50 0.1459 0.59
Length_Wake Sleep on Young -4.32 10.03 -0.18 0.8586 0.07 0.03 0.8711 0.07
Length_NREM Sleep on Old 7.88 9.97 0.57 0.5832 0.10 0.32 0.5933 0.10
Length_REM Age on Control 2.59 10.84 0.16 0.8747 0.13 0.03 0.8687 0.15
Porc_Wake Age on SR 14.79 8.50 0.66 0.5239 0.29 0.44 0.5322 0.26
Porc_NREM Sleep on Young -45.20 11.98 -1.86 0.0873 0.53 3.47 0.0956 0.53
Porc_REM Sleep on Old -45.92 7.26 -2.03 0.0809 0.91 4.10 0.0978 0.90
N_Wake Age on Control -6.38 10.21 -0.24 0.8142 0.09 0.06 0.7989 0.09
N_NREM Age on SR -7.10 9.35 -0.35 0.7320 0.11 0.12 0.7267 0.06
N_REM Sleep on Young -12.54 10.25 -2.67 0.0232 0.67 7.11 0.0256 0.67
Length_Wake Sleep on Old -0.84 8.71 -0.19 0.8572 0.12 0.03 0.8598 0.09
Length_NREM Age on Control -2.04 9.03 -0.45 0.6653 0.12 0.20 0.6711 0.12
Length_REM Age on SR 9.66 9.89 2.06 0.0665 0.60 4.25 0.0700 0.65
Porc_Wake Sleep on Young 3.91 10.73 1.14 0.2788 0.32 1.30 0.2511 0.32
Porc_NREM Sleep on Old 5.46 8.20 1.31 0.2247 0.61 1.72 0.2436 0.60
Porc_REM Age on Control -2.32 9.95 -0.51 0.6198 0.16 0.26 0.5989 0.17
N_Wake Age on SR -0.77 10.66 -0.27 0.7957 0.09 0.07 0.8040 0.09
N_NREM Sleep on Young -5.73 12.00 -1.54 0.1490 0.42 2.38 0.1122 0.42
N_REM Sleep on Old -9.04 7.57 -1.57 0.1568 0.39 2.47 0.1581 0.40
Length_Wake Age on Control 2.70 7.55 0.47 0.6506 0.18 0.22 0.6578 0.18
Length_NREM Age on SR -0.60 10.88 -0.16 0.8752 0.08 0.03 0.8665 0.08
Length_REM Sleep on Young 1.76 11.99 0.78 0.4479 0.24 0.62 0.4467 0.24
Porc_Wake Sleep on Old 0.87 9.56 0.43 0.6746 0.12 0.19 0.6600 0.13
Porc_NREM Age on Control 1.82 10.91 0.82 0.4277 0.29 0.68 0.4200 0.28
Porc_REM Age on SR 0.94 10.77 0.46 0.6548 0.14 0.21 0.6578 0.13
Extense Simple Effects Age-Sleep. Design 2x2
NmsSel Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
N_Wake Sleep on Young 19.57 9.92 1.20 0.2581 0.32 1.44 0.2222 0.32
N_NREM Sleep on Old 20.00 9.80 0.88 0.4019 0.17 0.77 0.4067 0.27
N_REM Age on Control -15.74 10.07 -0.71 0.4940 0.19 0.50 0.5000 0.20
Length_Wake Age on SR -15.31 8.05 -0.89 0.3989 0.25 0.79 0.4211 0.25
Length_NREM YSR vs OC -35.31 7.36 -1.84 0.1070 0.41 3.37 0.1123 0.42
Length_REM Sleep on Young 23.71 8.88 1.03 0.3281 0.30 1.07 0.3389 0.30
Porc_Wake Sleep on Old 38.33 5.66 2.73 0.0361 0.81 7.48 0.0678 0.80
Porc_NREM Age on Control 6.50 10.10 0.26 0.7965 0.18 0.07 0.7989 0.17
Porc_REM Age on SR 21.12 7.33 1.94 0.0923 0.59 3.75 0.1011 0.58
N_Wake YSR vs OC -17.21 9.75 -1.01 0.3375 0.23 1.02 0.3593 0.22
N_NREM Sleep on Young 16.86 9.56 1.41 0.1911 0.52 1.98 0.1889 0.52
N_REM Sleep on Old -13.83 9.83 -0.84 0.4221 0.32 0.70 0.4131 0.37
Length_Wake Age on Control 8.93 10.79 0.59 0.5653 0.22 0.35 0.5511 0.25
Length_NREM Age on SR -21.76 7.25 -1.58 0.1566 0.59 2.50 0.1550 0.59
Length_REM YSR vs OC -7.93 7.86 -0.64 0.5412 0.23 0.41 0.5484 0.20
Porc_Wake Sleep on Young -4.32 10.03 -0.18 0.8586 0.07 0.03 0.8867 0.07
Porc_NREM Sleep on Old 7.88 9.97 0.57 0.5832 0.10 0.32 0.5913 0.10
Porc_REM Age on Control 2.59 10.84 0.16 0.8747 0.12 0.03 0.9011 0.13
N_Wake Age on SR 14.79 8.50 0.66 0.5239 0.29 0.44 0.5478 0.31
N_NREM YSR vs OC 6.91 8.74 0.31 0.7657 0.22 0.09 0.7887 0.30
N_REM Sleep on Young -45.20 11.98 -1.86 0.0873 0.53 3.47 0.0856 0.53
Length_Wake Sleep on Old -45.92 7.26 -2.03 0.0809 0.91 4.10 0.0989 0.90
Length_NREM Age on Control -6.38 10.21 -0.24 0.8142 0.09 0.06 0.8156 0.09
Length_REM Age on SR -7.10 9.35 -0.35 0.7320 0.19 0.12 0.7033 0.19
Porc_Wake YSR vs OC 38.83 10.38 1.45 0.1774 0.52 2.09 0.1947 0.52
Porc_NREM Sleep on Young -12.54 10.25 -2.67 0.0232 0.67 7.11 0.0200 0.67
Porc_REM Sleep on Old -0.84 8.71 -0.19 0.8572 0.11 0.03 0.8654 0.12
N_Wake Age on Control -2.04 9.03 -0.45 0.6653 0.11 0.20 0.6711 0.11
N_NREM Age on SR 9.66 9.89 2.06 0.0665 0.65 4.25 0.0857 0.60
N_REM YSR vs OC 10.50 10.98 1.92 0.0810 0.56 3.69 0.0723 0.58
Length_Wake Sleep on Young 3.91 10.73 1.14 0.2788 0.32 1.30 0.2836 0.32
Length_NREM Sleep on Old 5.46 8.20 1.31 0.2247 0.61 1.72 0.2581 0.61
Length_REM Age on Control -2.32 9.95 -0.51 0.6198 0.13 0.26 0.6133 0.18
Porc_Wake Age on SR -0.77 10.66 -0.27 0.7957 0.09 0.07 0.8328 0.09
Porc_NREM YSR vs OC -6.23 7.89 -1.53 0.1646 0.62 2.35 0.1735 0.64
Porc_REM Sleep on Young -5.73 12.00 -1.54 0.1490 0.42 2.38 0.1300 0.42
N_Wake Sleep on Old -9.04 7.57 -1.57 0.1568 0.39 2.47 0.1419 0.40
N_NREM Age on Control 2.70 7.55 0.47 0.6506 0.18 0.22 0.6730 0.17
N_REM Age on SR -0.60 10.88 -0.16 0.8752 0.08 0.03 0.8929 0.08
Length_Wake YSR vs OC 8.43 7.60 1.47 0.1816 0.39 2.16 0.1846 0.39
Length_NREM Sleep on Young 1.76 11.99 0.78 0.4479 0.24 0.62 0.4244 0.24
Length_REM Sleep on Old 0.87 9.56 0.43 0.6746 0.13 0.19 0.6585 0.11
Porc_Wake Age on Control 1.82 10.91 0.82 0.4277 0.32 0.68 0.4300 0.30
Porc_NREM Age on SR 0.94 10.77 0.46 0.6548 0.13 0.21 0.6622 0.13
Porc_REM YSR vs OC 0.07 10.95 0.03 0.9768 0.09 0.00 0.9744 0.11

7 Figure 6. Average power spectra and relative delta (RDP) and theta (RTP).


Figure 6. Average power spectra and relative delta (RDP) and theta (RTP) power during post-learning and recovery. A-D) Average NREM (A) and REM (B) power spectra and RDP in NREM (C) and RTP in REM during post-learning. E-H) Average NREM (E) and REM (F) power spectra and RDP in NREM (G) and RTP in REM (H) during recovery. RDP: 0.25-4 Hz, RTP: 4-10 Hz. Young control (n=11), young SD (n=11), old control (n=8), old SD (n=10). Asterisks (*) represent significance using alpha=0.05. Statistical details in Supplemental Statistical Table corresponding to Figure 6.


7.1 Fig 6C,D Band Power PostL {Design 2}

  NmBas="Fig6 C_D Band Power PostL"
  NmFich<-paste0(PathDesign,"BandPowerPostL.csv");
  NmFAlL<-paste0(PathDesign,NmBas)
  if (!dir.exists(NmFAlL)) {dir.create(NmFAlL)}
  NmFAlL<-paste0(NmFAlL,"/")
  DatDTFull <- data.table(read.table(NmFich, header=TRUE, sep=";", na.strings="NA", dec=",",strip.white=TRUE))
  DatDT<-DatDTFull
  DatDT$Group<-factor(DatDT$Group);DatDT$Group<-relevel(DatDT$Group,"Young_C")
  ResFn<-ResAOV1<-list()
  
  for (i in 1:5) {
    DepVar<-names(DatDTFull)[8+i]
    YuenRes<-WRS2::yuen(get(DepVar)~Group,DatDT)
    ResFnPrv<-data.table(with(YuenRes,
                              cbind(DepV=DepVar,diff=round(diff,2),df=round(df,2),test=round(test,2),
                                    EffSize=round(effsize,2),p=round(p.value,4))))
    ResFn<-rbind(ResFn,ResFnPrv)
    lvs<-c(4,7,8+i)
    DatDTG<-DatDTFull[,..lvs];
    DatDTG$Age<-factor(DatDTG$Age)
    DatDTG$Age<-relevel(DatDTG$Age,"Young")
    setkey(DatDTG,Age)

    ArPGlobal<-c(lapply(1:2, function (x) DatDTG[.(levels(DatDTG$Age)[x]),3,with=F][[1]]),recursive = F)
    ResAOV1[[i]]<-AOVSingle(ArPGlobal,2)
  }
  rbResRb22<-data.table(Vars=names(DatDTFull)[9:13],do.call(rbind, lapply(ResAOV1, as.data.table)))
  
  GrpF<-list()
  DepVar1<-names(DatDTFull)[8+1]
  GrpF$A<- Grph.1(DatDT,DepVar1,LblsP =c("Preference for Displaced Object", "","Relative Delta Power"),c(0,50),F,GrpSel=c(1,3))
  DepVar2<-names(DatDTFull)[8+2]
  GrpF$B<- Grph.1(DatDT,DepVar2,LblsP =c("Preference for Displaced Object", "","Relative Sigma Power"),c(0,50),F,GrpSel=c(1,3))
  DepVar3<-names(DatDTFull)[8+3]
  GrpF$C<- Grph.1(DatDT,DepVar3,LblsP =c("Preference for Displaced Object", "","Relative Theta Power"),c(0,100),F,GrpSel=c(1,3))
  DepVar4<-names(DatDTFull)[8+4]
  GrpF$D<- Grph.1(DatDT,DepVar4,LblsP =c("Preference for Displaced Object", "","Relative Beta Power"),c(0,50),F,GrpSel=c(1,3))
  DepVar5<-names(DatDTFull)[8+5]
  GrpF$E<- Grph.1(DatDT,DepVar5,LblsP =c("Preference for Displaced Object", "",DepVar5),c(300,320),F,GrpSel=c(1,3))
  
  ResRes<-list()
  #ResRes[[1]]<-ResFn
  ResRes[[1]]<-rbResRb22
  AlmacenGen3(GrpP = GrpF,DataPas = ResRes,PathDesignP = PathDesign,NmBasP = NmBas, Typ=1)
  
  NmBas2="Fig6C RelDeltaPower PostL"
  pdf(paste0(NmFAlL,NmBas2,".pdf"))
     GrpF$A
  dev.off()
  NmBas3="Fig6D RelTethaPower PostL"
  pdf(paste0(NmFAlL,NmBas3,".pdf"))
     GrpF$C
  dev.off()
    
  pdf(paste0(NmFAlL,NmBas,"TodosGraphs.pdf"))
     GrpF
  dev.off()
  
  # All
  rrt<-ExDataIS.3c(nmF = paste0(PathDesign,"BandPowerPostL.csv"),Vars = c(4,5,7,9:12),vIntP =c(4:7),lvlCh = list("Delta"="delta_NREM", "Sigma"="sigma_NREM","Theta"="theta_REM","Beta"="beta_REM"))
  
  GrpF2<-list()
  GrpF2<-Grph.3b(rrt$ExtendDT,"Moment",LblsP =c("Preference for Unmoved Objects", "","Relative Power"),c(0,100),GrpSel = c(1,3),F)
  
  pdf(paste0(NmFAlL,NmBas,"TodosGraphs.pdf"))
     GrpF2
    dev.off()
    
    #Results
    print("Fig6C RelDeltaPower PostL")
    plot(GrpF$A)
    print("Fig6D RelTethaPower PostL")
    plot(GrpF$C)
    ResRes
    
    Kbl3(ResRes, "Omnibus AOV. Design 2")
quartz_off_screen 
                2 
quartz_off_screen 
                2 
$A

$B

$C

$D

$E

quartz_off_screen 
                2 
quartz_off_screen 
                2 
[1] "Fig6C RelDeltaPower PostL"
[1] "Fig6D RelTethaPower PostL"
[[1]]
           Vars                                                         t
1:   delta_NREM Diff = -4.17, V(9.63) = 0.87, Eff.Size = 0.26, p = 0.4057
2:   sigma_NREM  Diff = 2.77, V(8.18) = 1.77, Eff.Size = 0.64, p = 0.1147
3:    theta_REM  Diff = 7.97, V(5.59) = 1.02, Eff.Size = 0.49, p = 0.3495
4:     beta_REM   Diff = 1.27, V(8.71) = 0.9, Eff.Size = 0.27, p = 0.3939
5: totalPercent Diff = 1.24, V(10.98) = 1.89, Eff.Size = 0.54, p = 0.0852
                                                            tRk1 t.2.Diff
1: Diff = -4.17, Fw(1,13.46) = 0.56, Eff.Size = 0.26, p = 0.4665    -4.17
2:  Diff = 2.77, Fw(1,14.49) = 1.35, Eff.Size = 0.64, p = 0.2635     2.77
3:   Diff = 7.97, Fw(1,12.89) = 0.56, Eff.Size = 0.49, p = 0.469     7.97
4:  Diff = 1.27, Fw(1,11.05) = 1.06, Eff.Size = 0.27, p = 0.3247     1.27
5:   Diff = 1.24, Fw(1,14.3) = 2.34, Eff.Size = 0.54, p = 0.1476     1.24
   t.2.DF t.2.FW t.2.Ef.Size  t.2.p tRk2.Diff tRk2.DF1 tRk2.DF2 tRk2.Fw
1:   9.63   0.87        0.26 0.4057     -4.17        1    13.46    0.56
2:   8.18   1.77        0.64 0.1147      2.77        1    14.49    1.35
3:   5.59   1.02        0.49 0.3495      7.97        1    12.89    0.56
4:   8.71   0.90        0.27 0.3939      1.27        1    11.05    1.06
5:  10.98   1.89        0.54 0.0852      1.24        1    14.30    2.34
   tRk2.Ef.Size tRk2.p
1:         0.26 0.4665
2:         0.64 0.2635
3:         0.49 0.4690
4:         0.27 0.3247
5:         0.54 0.1476
Omnibus AOV. Design 2
Vars t tRk1 t.2.Diff t.2.DF t.2.FW t.2.Ef.Size t.2.p tRk2.Diff tRk2.DF1 tRk2.DF2 tRk2.Fw tRk2.Ef.Size tRk2.p
delta_NREM Diff = -4.17, V(9.63) = 0.87, Eff.Size = 0.26, p = 0.4057 Diff = -4.17, Fw(1,13.46) = 0.56, Eff.Size = 0.26, p = 0.4665 -4.17 9.63 0.87 0.26 0.4057 -4.17 1 13.46 0.56 0.26 0.4665
sigma_NREM Diff = 2.77, V(8.18) = 1.77, Eff.Size = 0.64, p = 0.1147 Diff = 2.77, Fw(1,14.49) = 1.35, Eff.Size = 0.64, p = 0.2635 2.77 8.18 1.77 0.64 0.1147 2.77 1 14.49 1.35 0.64 0.2635
theta_REM Diff = 7.97, V(5.59) = 1.02, Eff.Size = 0.49, p = 0.3495 Diff = 7.97, Fw(1,12.89) = 0.56, Eff.Size = 0.49, p = 0.469 7.97 5.59 1.02 0.49 0.3495 7.97 1 12.89 0.56 0.49 0.4690
beta_REM Diff = 1.27, V(8.71) = 0.9, Eff.Size = 0.27, p = 0.3939 Diff = 1.27, Fw(1,11.05) = 1.06, Eff.Size = 0.27, p = 0.3247 1.27 8.71 0.90 0.27 0.3939 1.27 1 11.05 1.06 0.27 0.3247
totalPercent Diff = 1.24, V(10.98) = 1.89, Eff.Size = 0.54, p = 0.0852 Diff = 1.24, Fw(1,14.3) = 2.34, Eff.Size = 0.54, p = 0.1476 1.24 10.98 1.89 0.54 0.0852 1.24 1 14.30 2.34 0.54 0.1476

7.2 Fig 6G,H Band Power Recover {Design 2*2}

  NmBas="Fig6G RelDeltaPowerNREM Recover"
  rrt<-ExData.2(nmF = paste0(PathDesign,"BandPowerRecover.csv"),Vars = c(4:5,9))
  DatDT<-rrt$DT
  ArP<-rrt$Arp
  
  #Graphs
  Grp<- Grph.2(DatDT,"delta_NREM",LblsP =c("Preference for Unmoved Objects", "","Relative Delta Power"),c(0,50),F)
  Grp2<- Grp + geom_signif(annotation="*",
              y_position=40, xmin=1  , xmax=2, 
              tip_length = c(0.02, 0.02),vjust=0.5,textsize=10) +
    geom_signif(annotation="*",
              y_position=40, xmin=3  , xmax=4, 
              tip_length = c(0.02, 0.02),vjust=0.5,textsize=10)
  # AOV & Simple Effects
  names(rrt$DT)[3]<-"DepV"
  ResGen<-AOVBwF(2,2,DatPas = rrt,nBMM = 10000)
  AlmacenGen(GrpP = Grp,Grp2P = Grp2,DataPas = ResGen,PathDesignP = PathDesign,NmBasP = NmBas,Typ=1)
  
  #Results Fig6G RelDeltaPowerNREM Recover
        # Results
        plot(Grp)
        plot(Grp2) # Only this graph is printed in the html file.
        ResGen  # Lean option to view the results of statistical analysis
        
        Kbl3(ResGen[[1]], "Omnibus AOV. Design 2x2");cat("\n")
        Kbl3(ResGen[[2]], "Simple Effects Age-Sleep. Design 2x2")
        Kbl3(ResGen[[3]], "Extense Simple Effects Age-Sleep. Design 2x2")
  
NmBas="Fig6H RelThetaPowerREM Recover"
  rrt<-ExData.2(nmF = paste0(PathDesign,"BandPowerRecover.csv"),Vars = c(4:5,11))
  DatDT<-rrt$DT
  ArP<-rrt$Arp  
  
  #Graphs
  Grp<- Grph.2(DatDT,"theta_REM",LblsP =c("Preference for Unmoved Objects", "","Relative Theta Power"),c(0,100),F)
  Grp2=Grp
  
  # AOV & Simple Effects
  names(rrt$DT)[3]<-"DepV"
  ResGen<-AOVBwF(2,2,DatPas = rrt,nBMM = 10000)
  AlmacenGen(Grp,Grp2,ResGen,PathDesign,NmBas,Typ=1)
  
  #Results Fig6H RelThetaPowerREM Recover
        # Results
        plot(Grp)
        plot(Grp2) # Only this graph is printed in the html file.
        ResGen  # Lean option to view the results of statistical analysis
        
        Kbl3(ResGen[[1]], "Omnibus AOV. Design 2x2");cat("\n")
        Kbl3(ResGen[[2]], "Simple Effects Age-Sleep. Design 2x2")
        Kbl3(ResGen[[3]], "Extense Simple Effects Age-Sleep. Design 2x2")
  
# All
  rrt<-ExDataIS.2(nmF = paste0(PathDesign,"BandPowerRecover.csv"),Vars = c(4,5,7,9:12),vIntP =c(4:7),
                  lvlCh = list("Delta"="delta_NREM", "Sigma"="sigma_NREM","Theta"="theta_REM","Beta"="beta_REM"))
  GrpF<-Grph.3(rrt$ExtendDT,"Moment",LblsP =c("Preference for Unmoved Objects", "","Relative Power"),c(0,100),F)
  NmBas="FigBP_Band Power Recover All Bands"
  NmFAlL<-paste0(PathDesign,NmBas)
  if (!dir.exists(NmFAlL)) {dir.create(NmFAlL)}
  NmFAlL<-paste0(NmFAlL,"/")
    
  pdf(paste0(NmFAlL,NmBas,"TodosGraphs.pdf"))
     GrpF
  dev.off()
[1] "Taking bootstrap samples. Please wait."
          Eff   p.V1 p.Sig
1:  A.p.value 0.5659      
2:  B.p.value 0.0067 *    
3: AB.p.value 0.0868      
[1] "Taking bootstrap samples. Please wait."
          Eff   p.V1 p.Sig
1:  A.p.value 0.5780      
2:  B.p.value 0.0056 *    
3: AB.p.value 0.8925      
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot   Sig pBootMas SigMas
1:       Age 0.33 0.574   0.33  0.574  0.38 0.5434 0.5659         0.5780       
2:     Sleep 9.40 0.007   9.40  0.007  9.23 0.0052 0.0067 *       0.0056  *    
3: Age*Sleep 0.02 0.895   0.04  0.840  0.01 0.9393 0.0868         0.8925       
   EffSize
1:    0.16
2:    0.64
3:    0.05

$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -7.21 11.12 -2.19  0.0507      0.67      4.80 0.0489
2:   Sleep on Old  -6.60  6.33 -2.15  0.0731      0.64      4.61 0.0778
3: Age on Control  -1.60  9.10 -0.46  0.6586      0.10      0.21 0.6333
4:      Age on SR  -0.99  7.87 -0.35  0.7365      0.15      0.12 0.7478
   EffSize.Boot
1:         0.67
2:         0.64
3:         0.11
4:         0.11

$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -7.21 11.12 -2.19  0.0507      0.67      4.80 0.0544
2:   Sleep on Old  -6.60  6.33 -2.15  0.0731      0.64      4.61 0.0644
3: Age on Control  -1.60  9.10 -0.46  0.6586      0.12      0.21 0.6622
4:      Age on SR  -0.99  7.87 -0.35  0.7365      0.15      0.12 0.7511
5:      YSR vs OC   5.61 10.64  1.44  0.1799      0.51      2.06 0.1791
   EffSize.Boot
1:         0.67
2:         0.64
3:         0.12
4:         0.15
5:         0.52
Omnibus AOV. Design 2x2
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.33 0.574 0.33 0.574 0.38 0.5434 0.5659 0.5780 0.16
Sleep 9.40 0.007 9.40 0.007 9.23 0.0052 0.0067
0.0056
0.64
Age*Sleep 0.02 0.895 0.04 0.840 0.01 0.9393 0.0868 0.8925 0.05
Simple Effects Age-Sleep. Design 2x2
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -7.21 11.12 -2.19 0.0507 0.67 4.80 0.0489 0.67
Sleep on Old -6.60 6.33 -2.15 0.0731 0.64 4.61 0.0778 0.64
Age on Control -1.60 9.10 -0.46 0.6586 0.10 0.21 0.6333 0.11
Age on SR -0.99 7.87 -0.35 0.7365 0.15 0.12 0.7478 0.11
Extense Simple Effects Age-Sleep. Design 2x2
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -7.21 11.12 -2.19 0.0507 0.67 4.80 0.0544 0.67
Sleep on Old -6.60 6.33 -2.15 0.0731 0.64 4.61 0.0644 0.64
Age on Control -1.60 9.10 -0.46 0.6586 0.12 0.21 0.6622 0.12
Age on SR -0.99 7.87 -0.35 0.7365 0.15 0.12 0.7511 0.15
YSR vs OC 5.61 10.64 1.44 0.1799 0.51 2.06 0.1791 0.52
[1] "Taking bootstrap samples. Please wait."
          Eff   p.V1 p.Sig
1:  A.p.value 0.6561      
2:  B.p.value 0.5977      
3: AB.p.value 0.3105      
[1] "Taking bootstrap samples. Please wait."
          Eff   p.V1 p.Sig
1:  A.p.value 0.6222      
2:  B.p.value 0.5920      
3: AB.p.value 0.1709      
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 0.26 0.620   0.26  0.620  0.35 0.5611 0.6561       0.6222       
2:     Sleep 0.30 0.594   0.30  0.594  0.49 0.4921 0.5977       0.5920       
3: Age*Sleep 2.25 0.158  -0.33  0.100  2.37 0.1355 0.3105       0.1709       
   EffSize
1:    0.18
2:    0.20
3:    0.60

$Detall
            Contr psihat   df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  10.15 7.24  1.73  0.1256      0.66      3.00 0.1322
2:   Sleep on Old  -4.71 6.45 -0.59  0.5757      0.31      0.35 0.5900
3: Age on Control   4.91 5.59  0.64  0.5483      0.43      0.41 0.5522
4:      Age on SR  -9.96 8.94 -1.59  0.1469      0.57      2.52 0.1544
   EffSize.Boot
1:         0.66
2:         0.29
3:         0.32
4:         0.57

$DetallExt
            Contr psihat   df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  10.15 7.24  1.73  0.1256      0.66      3.00 0.1433
2:   Sleep on Old  -4.71 6.45 -0.59  0.5757      0.31      0.35 0.5922
3: Age on Control   4.91 5.59  0.64  0.5483      0.29      0.41 0.5956
4:      Age on SR  -9.96 8.94 -1.59  0.1469      0.58      2.52 0.1411
5:      YSR vs OC  -5.24 9.64 -0.56  0.5868      0.18      0.32 0.6022
   EffSize.Boot
1:         0.66
2:         0.31
3:         0.29
4:         0.57
5:         0.21
Omnibus AOV. Design 2x2
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.26 0.620 0.26 0.620 0.35 0.5611 0.6561 0.6222 0.18
Sleep 0.30 0.594 0.30 0.594 0.49 0.4921 0.5977 0.5920 0.20
Age*Sleep 2.25 0.158 -0.33 0.100 2.37 0.1355 0.3105 0.1709 0.60
Simple Effects Age-Sleep. Design 2x2
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 10.15 7.24 1.73 0.1256 0.66 3.00 0.1322 0.66
Sleep on Old -4.71 6.45 -0.59 0.5757 0.31 0.35 0.5900 0.29
Age on Control 4.91 5.59 0.64 0.5483 0.43 0.41 0.5522 0.32
Age on SR -9.96 8.94 -1.59 0.1469 0.57 2.52 0.1544 0.57
Extense Simple Effects Age-Sleep. Design 2x2
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 10.15 7.24 1.73 0.1256 0.66 3.00 0.1433 0.66
Sleep on Old -4.71 6.45 -0.59 0.5757 0.31 0.35 0.5922 0.31
Age on Control 4.91 5.59 0.64 0.5483 0.29 0.41 0.5956 0.29
Age on SR -9.96 8.94 -1.59 0.1469 0.58 2.52 0.1411 0.57
YSR vs OC -5.24 9.64 -0.56 0.5868 0.18 0.32 0.6022 0.21
quartz_off_screen 
                2 

8 Figure 7. Spindle characteristics.


Figure 7. Spindle characteristics. A) Representation of the automated spindle detection method. Top panel shows the cubed root-mean squared (RMS) of the filtered EEG computed over 750 ms windows. The spindle detection method used a two-threshold approach. These values are derived from the mean cubed RMS transform value of all the NREM traces and included both a lower threshold and upper threshold. The second panel shows the band-pass filtered EEG, followed by the unfiltered EEG signal, and the results of the spindle detection. The bottom panel shows the corresponding EMG signal. Red marks the regions of the signal where spindles are detected, 1 indicates the presence and 0 the absence of spindles, respectively. B-D) Spindle counts (B), duration (C), and frequency (D) during the post-learning sleep period. B) There were no differences between the groups in total average number of spindles, but segment analysis revealed that old control animals displayed less spindles than young control animals during the first hour post-learning. C-D) There were no differences in spindles duration (D) or frequency (D) during post-learning. E-G) Spindle numbers (E), duration (F), and frequency (G) during recovery. G) Old SD animals displayed more average total number of spindles than old controls during the 5 hr recovery sleep period. The 1 hr segment analysis indicated that the groups displayed more spindles during the last segment than the preceding one. F) There were no differences in spindles duration. G) Young SD mice displayed higher spindle frequency than old SD animals. Young control (n=11), young SD (n=11), old control (n=8), old SD (n=10). Asterisks (*) represent significance using alpha=0.05. Statistical details in Supplemental Statistical Table corresponding to Figure 7.


8.1 Fig 7B Spindle counts during the post-learning sleep period {Design 2x((5+1)xS)

  NmBas="Fig7B SpindCount PosL"
  NmFich<-paste0(PathDesign,"DeltaTetaSpindlePostL.csv");
  DatDTFull <- data.table(read.table(NmFich, header=TRUE, sep=";", na.strings="NA", dec=",",strip.white=TRUE))
  NmFAlL<-paste0(PathDesign,NmBas)
  if (!dir.exists(NmFAlL)) {dir.create(NmFAlL)}
  NmFAlL<-paste0(NmFAlL,"/")
  ResGen<-NA;rbResRbGl<-list()
  
  # Graphs Previously
  rrt<-ExDataIS.3c(nmF = NmFich,Vars = ,c(4,5,7,17:22),vIntP =c(4:9),lvlCh = list("Hr 1"="NREM_Spindle_1", "Hr 2"="NREM_Spindle_2","Hr 3"="NREM_Spindle_3","Hr 4"="NREM_Spindle_4","Hr 5"="NREM_Spindle_5","Total"="NREM_Spindle_TT"))
  DatDT<-rrt$DT
  ArP<-rrt$Arp
  ExtendDT<-rrt$ExtendDT
  Grp<- Grph.3b(DatP = ExtendDT,"OPR",LblsP =c("Spindle Characteristics", "","Spindle Count"),ylmP =c(0,500),hLin = F,lvIp = 6,GrpSel = c(1,3))
  
  levBp<-seq(0.8, 6, by=0.4)
  Grp2<- Grp + geom_signif(annotation="*",
              y_position=350, xmin=levBp[1]  , xmax=levBp[2], 
              tip_length = c(0.20, 0.35),vjust = 0.5, textsize=10)
  
  #AOV 1 Global
  DatDTG<-DatDTFull[,c(4,7,22)];
  DatDTG$Age<-factor(DatDTG$Age)
  DatDTG$Age<-relevel(DatDTG$Age,"Young")
  setkey(DatDTG,Age)

  ArPGlobal<-c(lapply(1:2, function (x) DatDTG[.(levels(DatDTG$Age)[x]),3,with=F][[1]]),recursive = F)
  ResAOV1<-AOVSingle(ArPGlobal,2)
  rbResRbGl$AOV<-do.call(cbind, lapply(ResAOV1, as.data.table))
    write.csv2(rbResRbGl$AOV,paste0(NmFAlL, NmBas,"GlobalOmnContr.csv"))
  
  #AOV 2 For Time Details
  rrt2<-ExDataIS.3c(nmF = NmFich,Vars = ,c(4,5,7,17:21),vIntP =c(4:8),lvlCh = list("Hr 1"="NREM_Spindle_1", "Hr 2"="NREM_Spindle_2","Hr 3"="NREM_Spindle_3","Hr 4"="NREM_Spindle_4","Hr 5"="NREM_Spindle_5"))

  names(rrt2$DT)[3:7]<-c("T1","T2","T3","T4","T5")
  ResGen<-AOVMx2b(A=2,C=5,DatPas = rrt2,nBMM1 = 10000,nBMM2 = 1000,Prc = 2)
  AlmacenGen(GrpP = Grp,Grp2P = Grp2,DataPas = ResGen,PathDesignP = PathDesign,NmBasP = NmBas,Typ=1)
  
  # Other Graphs for Time details
    ExtendDT2<-rrt2$ExtendDT
    ExtendDTCol<-copy(ExtendDT2)
    ExtendDTCol$Moment<-"All"
    ExtendDTCol<-data.table(rbind(ExtendDT2,ExtendDTCol))
    
    Grp3<- Grph.3b(DatP = ExtendDTCol,"OPR",LblsP =c("Spindle Characteristics", "","Spindle Count"),ylmP =c(0,500),hLin = F,lvIp = 6,GrpSel = c(1,3),wMain = T)
    
    pdf(paste0(NmFAlL,NmBas,"OtrosGraphs.pdf"))
      Grp3
    dev.off()
    
    #Results
    plot(Grp)
    plot(Grp2)
    plot(Grp3)
    
    #AOV 1 Global
    rbResRbGl
    Kbl3(rbResRbGl, "Global Omnibus AOV. Design 2")
    
    #AOV 2 For Time Details
    ResGen
    Kbl3(ResGen[[1]], "Omnibus AOV. Design 2x(5xS)")
    Kbl3(ResGen[[2]], "Simple Effects Age-Time. Design 2x(5xS)")
    Kbl3(ResGen[[3]], "Main Effects Time. Design 2x(5xS)")
[1] "Taking bootstrap samples. Please wait."
[1] "Taking bootstrap samples. Please wait."
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
quartz_off_screen 
                2 
$AOV
                                                        t.V1
1: Diff = 4.33, V(10.99) = 0.52, Eff.Size = 0.17, p = 0.6148
                                                        tRk1.V1 t.2.Diff t.2.DF
1: Diff = 4.33, Fw(1,14.93) = 0.22, Eff.Size = 0.17, p = 0.6445     4.33  10.99
   t.2.FW t.2.Ef.Size  t.2.p tRk2.Diff tRk2.DF1 tRk2.DF2 tRk2.Fw tRk2.Ef.Size
1:   0.52        0.17 0.6148      4.33        1    14.93    0.22         0.17
   tRk2.p
1: 0.6445
Global Omnibus AOV. Design 2
t.V1 tRk1.V1 t.2.Diff t.2.DF t.2.FW t.2.Ef.Size t.2.p tRk2.Diff tRk2.DF1 tRk2.DF2 tRk2.Fw tRk2.Ef.Size tRk2.p
Diff = 4.33, V(10.99) = 0.52, Eff.Size = 0.17, p = 0.6148 Diff = 4.33, Fw(1,14.93) = 0.22, Eff.Size = 0.17, p = 0.6445 4.33 10.99 0.52 0.17 0.6148 4.33 1 14.93 0.22 0.17 0.6445
$AOV
       Names    Q      p  pBoot   Sig pBootMas  Sig2 EffSize
1:       Age 0.86 0.3767 0.4073         0.3741          0.02
2:     Trial 9.07 0.0043 0.0417 *       0.0401 *        0.41
3: Age*Trial 4.52 0.0324 0.1018         0.1135          0.43

$InterAC
             Contr  psihat    df  test p.value EfSize.V1
 1:      Age on M1  128.83 10.06  4.18  0.0019      0.82
 2:      Age on M2   15.45  8.23  0.34  0.7408      0.11
 3:      Age on M3  -35.71  6.96 -1.01  0.3446      0.33
 4:      Age on M4  -40.43 10.24 -1.29  0.2248      0.37
 5:      Age on M5  -14.36  7.36 -0.36  0.7278      0.11
 6: M1-M2 on Young  -60.00    NA -1.32  0.2454      0.55
 7:   M1-M2 on Old -159.50    NA -4.92  0.0044      0.83
 8: M2-M3 on Young   12.50    NA  0.23  0.8289      0.21
 9:   M2-M3 on Old  -19.00    NA -0.28  0.7939      0.21
10: M3-M4 on Young   58.67    NA  1.65  0.1601      0.32
11:   M3-M4 on Old   14.00    NA  0.24  0.8199      0.19
12: M4-M5 on Young    0.83    NA  0.02  0.9842      0.20
13:   M4-M5 on Old   31.67    NA  0.51  0.6330      0.32

$DetallMainC
   Contr  psihat  test p.value Psihat2 p.value2 EfSize.V1
1: M1-M2 -207.83 -4.73  0.0052 -225.95     0.00      0.71
2: M2-M3  -19.33 -0.26  0.8086  -11.17     0.80      0.01
3: M3-M4   54.83  0.95  0.3849   48.71     0.32      0.25
4: M4-M5   62.83  1.26  0.2632   60.93     0.24      0.29
Omnibus AOV. Design 2x(5xS)
Names Q p pBoot Sig pBootMas Sig2 EffSize
Age 0.86 0.3767 0.4073 0.3741 0.02
Trial 9.07 0.0043 0.0417
0.0401
0.41
Age*Trial 4.52 0.0324 0.1018 0.1135 0.43
Simple Effects Age-Time. Design 2x(5xS)
Contr psihat df test p.value EfSize.V1
Age on M1 128.83 10.06 4.18 0.0019 0.82
Age on M2 15.45 8.23 0.34 0.7408 0.11
Age on M3 -35.71 6.96 -1.01 0.3446 0.33
Age on M4 -40.43 10.24 -1.29 0.2248 0.37
Age on M5 -14.36 7.36 -0.36 0.7278 0.11
M1-M2 on Young -60.00 NA -1.32 0.2454 0.55
M1-M2 on Old -159.50 NA -4.92 0.0044 0.83
M2-M3 on Young 12.50 NA 0.23 0.8289 0.21
M2-M3 on Old -19.00 NA -0.28 0.7939 0.21
M3-M4 on Young 58.67 NA 1.65 0.1601 0.32
M3-M4 on Old 14.00 NA 0.24 0.8199 0.19
M4-M5 on Young 0.83 NA 0.02 0.9842 0.20
M4-M5 on Old 31.67 NA 0.51 0.6330 0.32
Main Effects Time. Design 2x(5xS)
Contr psihat test p.value Psihat2 p.value2 EfSize.V1
M1-M2 -207.83 -4.73 0.0052 -225.95 0.00 0.71
M2-M3 -19.33 -0.26 0.8086 -11.17 0.80 0.01
M3-M4 54.83 0.95 0.3849 48.71 0.32 0.25
M4-M5 62.83 1.26 0.2632 60.93 0.24 0.29

8.2 Fig 7C Duration during the post-learning sleep period {Design 2x((5+1)xS)

  NmBas="Fig7C AvgSpindDurat PostL"
  NmFich<-paste0(PathDesign,"DeltaTetaSpindlePostL.csv");
  DatDTFull <- data.table(read.table(NmFich, header=TRUE, sep=";", na.strings="NA", dec=",",strip.white=TRUE))
  NmFAlL<-paste0(PathDesign,NmBas)
  if (!dir.exists(NmFAlL)) {dir.create(NmFAlL)}
  NmFAlL<-paste0(NmFAlL,"/")
  ResGen<-NA;rbResRbGl<-list()

 # Graphs Previously
  rrt<-ExDataIS.3c(nmF = NmFich,Vars = ,c(4,5,7,23:28),vIntP =c(4:9),lvlCh = list("Hr 1"="Avg_SpindleDuration_NREM_1", "Hr 2"="Avg_SpindleDuration_NREM_2","Hr 3"="Avg_SpindleDuration_NREM_3","Hr 4"="Avg_SpindleDuration_NREM_4","Hr 5"="Avg_SpindleDuration_NREM_5","Total"="Avg_SpindleDuration_NREM_TT"))
  DatDT<-rrt$DT
  ArP<-rrt$Arp
  ExtendDT<-rrt$ExtendDT
  Grp<- Grph.3b(DatP = ExtendDT,"OPR",LblsP =c("Spindle Characteristics", "","Spindle Duration (s)"),ylmP =c(0,3),hLin = F,lvIp = 6,GrpSel = c(1,3))
  Grp2=Grp
  
  #AOV 1 Global
  DatDTG<-DatDTFull[,c(4,7,28)];
  DatDTG$Age<-factor(DatDTG$Age)
  DatDTG$Age<-relevel(DatDTG$Age,"Young")
  setkey(DatDTG,Age)

  ArPGlobal<-c(lapply(1:2, function (x) DatDTG[.(levels(DatDTG$Age)[x]),3,with=F][[1]]),recursive = F)
  ResAOV1<-AOVSingle(ArPGlobal,2)
  rbResRbGl$AOV<-do.call(cbind, lapply(ResAOV1, as.data.table))
    write.csv2(rbResRbGl$AOV,paste0(NmFAlL, NmBas,"GlobalOmnContr.csv"))
  
  #AOV 2 For Time Details
  rrt2<-ExDataIS.3c(nmF = NmFich,Vars = ,c(4,5,7,23:27),vIntP =c(4:8),lvlCh = list("Hr 1"="Avg_SpindleDuration_NREM_1", "Hr 2"="Avg_SpindleDuration_NREM_2","Hr 3"="Avg_SpindleDuration_NREM_3","Hr 4"="Avg_SpindleDuration_NREM_4","Hr 5"="Avg_SpindleDuration_NREM_5"))

  names(rrt2$DT)[3:7]<-c("T1","T2","T3","T4","T5")
  ResGen<-AOVMx2b(A=2,C=5,DatPas = rrt2,nBMM1 = 10000,nBMM2 = 1000,Prc = 2)
  AlmacenGen(GrpP = Grp,Grp2P = Grp2,DataPas = ResGen,PathDesignP = PathDesign,NmBasP = NmBas,Typ=1)

  # Other Graphs for Time details
    ExtendDT2<-rrt2$ExtendDT
    ExtendDTCol<-copy(ExtendDT2)
    ExtendDTCol$Moment<-"All"
    ExtendDTCol<-data.table(rbind(ExtendDT2,ExtendDTCol))
    
    Grp3<- Grph.3b(DatP = ExtendDTCol,"OPR",LblsP =c("Spindle Characteristics", "","Spindle Duration (s)"),ylmP =c(0,3),hLin = F,lvIp = 6,GrpSel = c(1,3),wMain = T)
    
    pdf(paste0(NmFAlL,NmBas,"OtrosGraphs.pdf"))
      Grp3
    dev.off()
    
    #Results
    plot(Grp)
    plot(Grp2)
    plot(Grp3)
    
    #AOV 1 Global
    rbResRbGl
    Kbl3(rbResRbGl, "Global Omnibus AOV. Design 2")
    
    #AOV 2 For Time Details
    ResGen
    Kbl3(ResGen[[1]], "Omnibus AOV. Design 2x(5xS)")
    Kbl3(ResGen[[2]], "Simple Effects Age-Time. Design 2x(5xS)")
    Kbl3(ResGen[[3]], "Main Effects Time. Design 2x(5xS)")
[1] "Taking bootstrap samples. Please wait."
[1] "Taking bootstrap samples. Please wait."
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
quartz_off_screen 
                2 
$AOV
                                                 t.V1
1: Diff = 0, V(8.67) = 0, Eff.Size = 0.09, p = 0.9969
                                                     tRk1.V1 t.2.Diff t.2.DF
1: Diff = 0, Fw(1,13.41) = 0.03, Eff.Size = 0.09, p = 0.8568        0   8.67
   t.2.FW t.2.Ef.Size  t.2.p tRk2.Diff tRk2.DF1 tRk2.DF2 tRk2.Fw tRk2.Ef.Size
1:      0        0.09 0.9969         0        1    13.41    0.03         0.09
   tRk2.p
1: 0.8568
Global Omnibus AOV. Design 2
t.V1 tRk1.V1 t.2.Diff t.2.DF t.2.FW t.2.Ef.Size t.2.p tRk2.Diff tRk2.DF1 tRk2.DF2 tRk2.Fw tRk2.Ef.Size tRk2.p
Diff = 0, V(8.67) = 0, Eff.Size = 0.09, p = 0.9969 Diff = 0, Fw(1,13.41) = 0.03, Eff.Size = 0.09, p = 0.8568 0 8.67 0 0.09 0.9969 0 1 13.41 0.03 0.09 0.8568
$AOV
       Names    Q      p  pBoot Sig pBootMas Sig2 EffSize
1:       Age 0.06 0.8183 0.7880       0.8171         0.17
2:     Trial 0.67 0.6344 0.7279       0.7452         0.20
3: Age*Trial 1.20 0.3837 0.5743       0.5679         0.44

$InterAC
             Contr psihat    df  test p.value EfSize.V1
 1:      Age on M1   0.25  5.42  0.97  0.3738      0.86
 2:      Age on M2   0.05  7.49  0.44  0.6758      0.17
 3:      Age on M3  -0.01 10.28 -0.14  0.8910      0.12
 4:      Age on M4  -0.06  5.39 -0.76  0.4770      0.37
 5:      Age on M5  -0.14 10.42 -1.50  0.1633      0.48
 6: M1-M2 on Young  -0.09    NA -1.69  0.1527      0.31
 7:   M1-M2 on Old  -0.24    NA -1.21  0.2814      0.56
 8: M2-M3 on Young   0.03    NA  1.09  0.3241      0.00
 9:   M2-M3 on Old  -0.07    NA -0.54  0.6134      0.34
10: M3-M4 on Young   0.04    NA  0.66  0.5364      0.34
11:   M3-M4 on Old   0.00    NA -0.03  0.9809      0.04
12: M4-M5 on Young   0.04    NA  1.42  0.2136      0.35
13:   M4-M5 on Old   0.00    NA  0.00  0.9966      0.13

$DetallMainC
   Contr psihat  test p.value Psihat2 p.value2 EfSize.V1
1: M1-M2  -0.29 -1.29  0.2530   -0.34    0.012      0.32
2: M2-M3  -0.04 -0.31  0.7690   -0.06    0.560      0.09
3: M3-M4   0.03  0.24  0.8199    0.04    0.736      0.17
4: M4-M5   0.02  0.18  0.8630    0.02    0.772      0.10
Omnibus AOV. Design 2x(5xS)
Names Q p pBoot Sig pBootMas Sig2 EffSize
Age 0.06 0.8183 0.7880 0.8171 0.17
Trial 0.67 0.6344 0.7279 0.7452 0.20
Age*Trial 1.20 0.3837 0.5743 0.5679 0.44
Simple Effects Age-Time. Design 2x(5xS)
Contr psihat df test p.value EfSize.V1
Age on M1 0.25 5.42 0.97 0.3738 0.86
Age on M2 0.05 7.49 0.44 0.6758 0.17
Age on M3 -0.01 10.28 -0.14 0.8910 0.12
Age on M4 -0.06 5.39 -0.76 0.4770 0.37
Age on M5 -0.14 10.42 -1.50 0.1633 0.48
M1-M2 on Young -0.09 NA -1.69 0.1527 0.31
M1-M2 on Old -0.24 NA -1.21 0.2814 0.56
M2-M3 on Young 0.03 NA 1.09 0.3241 0.00
M2-M3 on Old -0.07 NA -0.54 0.6134 0.34
M3-M4 on Young 0.04 NA 0.66 0.5364 0.34
M3-M4 on Old 0.00 NA -0.03 0.9809 0.04
M4-M5 on Young 0.04 NA 1.42 0.2136 0.35
M4-M5 on Old 0.00 NA 0.00 0.9966 0.13
Main Effects Time. Design 2x(5xS)
Contr psihat test p.value Psihat2 p.value2 EfSize.V1
M1-M2 -0.29 -1.29 0.2530 -0.34 0.012 0.32
M2-M3 -0.04 -0.31 0.7690 -0.06 0.560 0.09
M3-M4 0.03 0.24 0.8199 0.04 0.736 0.17
M4-M5 0.02 0.18 0.8630 0.02 0.772 0.10

8.3 Fig 7D Frequency during the post-learning sleep period {Design 2x((5+1)xS)

  NmBas="Fig7D SpindFreq PostL"
  NmFich<-paste0(PathDesign,"DeltaTetaSpindlePostL.csv");
  DatDTFull <- data.table(read.table(NmFich, header=TRUE, sep=";", na.strings="NA", dec=",",strip.white=TRUE))
  NmFAlL<-paste0(PathDesign,NmBas)
  if (!dir.exists(NmFAlL)) {dir.create(NmFAlL)}
  NmFAlL<-paste0(NmFAlL,"/")
  ResGen<-NA;rbResRbGl<-list()
  
# Graphs Previously
  rrt<-ExDataIS.3c(nmF = NmFich,Vars = ,c(4,5,7,29:34),vIntP =c(4:9),lvlCh = list("Hr 1"="Avg_SpindleHz_NREM_1", "Hr 2"="Avg_SpindleHz_NREM_2","Hr 3"="Avg_SpindleHz_NREM_3","Hr 4"="Avg_SpindleHz_NREM_4","Hr 5"="Avg_SpindleHz_NREM_5","Total"="Avg_SpindleHz_NREM_TT"))
  DatDT<-rrt$DT
  ArP<-rrt$Arp
  ExtendDT<-rrt$ExtendDT
  Grp<- Grph.3b(DatP = ExtendDT,"OPR",LblsP =c("Spindle Characteristics", "","Spindle Frequency (Hz)"),ylmP =c(10,12),hLin = F,lvIp = 6,GrpSel = c(1,3))
  
  Grp2=Grp
  
  #AOV 1 Global
  DatDTG<-DatDTFull[,c(4,7,34)];
  DatDTG$Age<-factor(DatDTG$Age)
  DatDTG$Age<-relevel(DatDTG$Age,"Young")
  setkey(DatDTG,Age)

  ArPGlobal<-c(lapply(1:2, function (x) DatDTG[.(levels(DatDTG$Age)[x]),3,with=F][[1]]),recursive = F)
  ResAOV1<-AOVSingle(ArPGlobal,2)
  rbResRbGl$AOV<-do.call(cbind, lapply(ResAOV1, as.data.table))
    write.csv2(rbResRbGl$AOV,paste0(NmFAlL, NmBas,"GlobalOmnContr.csv"))
  
  #AOV 2 For Time Details
  rrt2<-ExDataIS.3c(nmF = NmFich,Vars = ,c(4,5,7,29:33),vIntP =c(4:8),lvlCh = list("Hr 1"="Avg_SpindleHz_NREM_1", "Hr 2"="Avg_SpindleHz_NREM_2","Hr 3"="Avg_SpindleHz_NREM_3","Hr 4"="Avg_SpindleHz_NREM_4","Hr 5"="Avg_SpindleHz_NREM_5"))

  names(rrt2$DT)[3:7]<-c("T1","T2","T3","T4","T5")
  ResGen<-AOVMx2b(A=2,C=5,DatPas = rrt2,nBMM1 = 10000,nBMM2 = 1000,Prc = 2)
  AlmacenGen(GrpP = Grp,Grp2P = Grp2,DataPas = ResGen,PathDesignP = PathDesign,NmBasP = NmBas,Typ=1)
  
  # Other Graphs for Time details
    ExtendDT2<-rrt2$ExtendDT
    ExtendDTCol<-copy(ExtendDT2)
    ExtendDTCol$Moment<-"All"
    ExtendDTCol<-data.table(rbind(ExtendDT2,ExtendDTCol))
    
    Grp3<- Grph.3b(DatP = ExtendDTCol,"OPR",LblsP =c("Spindle Characteristics", "","Spindle Frequency (Hz)"),ylmP =c(10,12),hLin = F,lvIp = 6,GrpSel = c(1,3),wMain = T)
    
    pdf(paste0(NmFAlL,NmBas,"OtrosGraphs.pdf"))
      Grp3
    dev.off()
    
    #Results
    plot(Grp)
    plot(Grp2)
    plot(Grp3)
    
    #AOV 1 Global
    rbResRbGl
    Kbl3(rbResRbGl, "Global Omnibus AOV. Design 2")
    
    #AOV 2 For Time Details
    ResGen
    Kbl3(ResGen[[1]], "Omnibus AOV. Design 2x(5xS)")
    Kbl3(ResGen[[2]], "Simple Effects Age-Time. Design 2x(5xS)")
    Kbl3(ResGen[[3]], "Main Effects Time Design. 2x(5xS)")
[1] "Taking bootstrap samples. Please wait."
[1] "Taking bootstrap samples. Please wait."
Error in solve.default(test) : 
  sistema es computacionalmente singular: número de condición recíproco = 7.72411e-17
Error in round(unlist(DTpp), decim) : 
  non-numeric argument to mathematical function
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
quartz_off_screen 
                2 
$AOV
                                                    t.V1
1: Diff = 0, V(8.19) = 0.01, Eff.Size = 0.08, p = 0.9957
                                                     tRk1.V1 t.2.Diff t.2.DF
1: Diff = 0, Fw(1,13.14) = 0.01, Eff.Size = 0.08, p = 0.9283        0   8.19
   t.2.FW t.2.Ef.Size  t.2.p tRk2.Diff tRk2.DF1 tRk2.DF2 tRk2.Fw tRk2.Ef.Size
1:   0.01        0.08 0.9957         0        1    13.14    0.01         0.08
   tRk2.p
1: 0.9283
Global Omnibus AOV. Design 2
t.V1 tRk1.V1 t.2.Diff t.2.DF t.2.FW t.2.Ef.Size t.2.p tRk2.Diff tRk2.DF1 tRk2.DF2 tRk2.Fw tRk2.Ef.Size tRk2.p
Diff = 0, V(8.19) = 0.01, Eff.Size = 0.08, p = 0.9957 Diff = 0, Fw(1,13.14) = 0.01, Eff.Size = 0.08, p = 0.9283 0 8.19 0.01 0.08 0.9957 0 1 13.14 0.01 0.08 0.9283
$AOV
       Names    Q      p  pBoot Sig pBootMas Sig2 EffSize
1:       Age 0.22 0.6464 0.6644           NA   NA    0.21
2:     Trial 0.81 0.5524 0.6694           NA   NA    0.19
3: Age*Trial 0.34 0.8472 0.8815           NA   NA    0.13

$InterAC
             Contr psihat    df  test p.value EfSize.V1
 1:      Age on M1  -0.06  5.37 -0.32  0.7596      0.16
 2:      Age on M2   0.08 10.42  0.93  0.3745      0.27
 3:      Age on M3   0.04  8.39  0.51  0.6222      0.17
 4:      Age on M4   0.09 10.92  0.86  0.4102      0.38
 5:      Age on M5   0.05  6.43  0.55  0.5999      0.28
 6: M1-M2 on Young   0.06    NA  0.91  0.4043      0.24
 7:   M1-M2 on Old   0.13    NA  0.68  0.5261      0.47
 8: M2-M3 on Young   0.02    NA  0.43  0.6866      0.05
 9:   M2-M3 on Old  -0.04    NA -2.35  0.0654      0.14
10: M3-M4 on Young  -0.06    NA -0.73  0.5008      0.17
11:   M3-M4 on Old  -0.02    NA -0.35  0.7380      0.05
12: M4-M5 on Young   0.09    NA  1.05  0.3402      0.24
13:   M4-M5 on Old   0.06    NA  1.37  0.2291      0.07

$DetallMainC
   Contr psihat  test p.value Psihat2 p.value2 EfSize.V1
1: M1-M2   0.19  0.81  0.4564    0.26    0.256      0.37
2: M2-M3   0.02  0.21  0.8388   -0.02    0.832      0.08
3: M3-M4  -0.10 -1.38  0.2254   -0.03    0.548      0.04
4: M4-M5   0.12  1.65  0.1604    0.08    0.080      0.11
Omnibus AOV. Design 2x(5xS)
Names Q p pBoot Sig pBootMas Sig2 EffSize
Age 0.22 0.6464 0.6644 NA NA 0.21
Trial 0.81 0.5524 0.6694 NA NA 0.19
Age*Trial 0.34 0.8472 0.8815 NA NA 0.13
Simple Effects Age-Time. Design 2x(5xS)
Contr psihat df test p.value EfSize.V1
Age on M1 -0.06 5.37 -0.32 0.7596 0.16
Age on M2 0.08 10.42 0.93 0.3745 0.27
Age on M3 0.04 8.39 0.51 0.6222 0.17
Age on M4 0.09 10.92 0.86 0.4102 0.38
Age on M5 0.05 6.43 0.55 0.5999 0.28
M1-M2 on Young 0.06 NA 0.91 0.4043 0.24
M1-M2 on Old 0.13 NA 0.68 0.5261 0.47
M2-M3 on Young 0.02 NA 0.43 0.6866 0.05
M2-M3 on Old -0.04 NA -2.35 0.0654 0.14
M3-M4 on Young -0.06 NA -0.73 0.5008 0.17
M3-M4 on Old -0.02 NA -0.35 0.7380 0.05
M4-M5 on Young 0.09 NA 1.05 0.3402 0.24
M4-M5 on Old 0.06 NA 1.37 0.2291 0.07
Main Effects Time Design. 2x(5xS)
Contr psihat test p.value Psihat2 p.value2 EfSize.V1
M1-M2 0.19 0.81 0.4564 0.26 0.256 0.37
M2-M3 0.02 0.21 0.8388 -0.02 0.832 0.08
M3-M4 -0.10 -1.38 0.2254 -0.03 0.548 0.04
M4-M5 0.12 1.65 0.1604 0.08 0.080 0.11

8.4 Fig 7E Spindle numbers during recovery {Design 2x2x((5+1)xS)

  NmBas="Fig7E SpindCount Recover"
  NmFich<-paste0(PathDesign,"DeltaTetaSpindleRecover.csv");
  NmFAlL<-paste0(PathDesign,NmBas)
  if (!dir.exists(NmFAlL)) {dir.create(NmFAlL)}
  NmFAlL<-paste0(NmFAlL,"/")
  ResGen<-NA;ResGen1<-NA;
  
  # Graphs Previously
  rrt<-ExDataIS.2(nmF = NmFich,Vars = ,c(4,5,7,9:14),vIntP =c(4:9),lvlCh = list("Hr 1"="NREM_Spindle_1", "Hr 2"="NREM_Spindle_2","Hr 3"="NREM_Spindle_3","Hr 4"="NREM_Spindle_4","Hr 5"="NREM_Spindle_5","Total"="NREM_Spindle_TT"))
  DatDT<-rrt$DT
  ArP<-rrt$Arp
  ExtendDT<-rrt$ExtendDT
  
  Grp<- Grph.3(DatP = ExtendDT,"OPR",LblsP =c("Spindle Characteristics", "","Spindle Count"),ylmP =c(0,500),hLin = F,lvIp = 6)
  
  levBp<-seq(0.7, 25, by=0.2)
  Grp2<- Grp + geom_signif(annotation="*",
              y_position=325, xmin=levBp[2+25]  , xmax=levBp[4+25], 
              tip_length = c(0.02, 0.02),vjust=0.5,textsize=10) +
    geom_signif(annotation="*",
              y_position=300, xmin=levBp[3+25]  , xmax=levBp[4+25], 
              tip_length = c(0.02, 0.02),vjust=0.5,textsize=10)+
    geom_signif(annotation=c("","","*"),
              y_position=c(300,320,330),
              xmin=c(levBp[1+15],levBp[1+20], mean(levBp[c(1+15,4+15)])),
              xmax=c(levBp[4+15],levBp[4+20], mean(levBp[c(1+20,4+20)])), 
              tip_length = c(c(0.02, 0.02),c(0.02, 0.02),c(.05, 0.02)),vjust=0.5,textsize=10)
  
  #AOV 1 Global
  rrt<-ExData.2(nmF = NmFich,Vars = c(4,5,14))
  DatDT<-rrt$DT
  ArP<-rrt$Arp
  
  names(rrt$DT)[3]<-"DepV"
  ResGen1<-AOVBwF(2,2,DatPas = rrt,nBMM = 10000)
  AlmacenGen(Grp,Grp2,ResGen1,PathDesign,paste0(NmBas,"_Total"),Typ=1)
  
  #AOV 2 For Time Details
  rrt2<-ExDataIS.2(nmF = NmFich,Vars = c(4,5,7,9:13),vIntP =c(4:8),lvlCh = list("Hr 1"="NREM_Spindle_1", "Hr 2"="NREM_Spindle_2","Hr 3"="NREM_Spindle_3","Hr 4"="NREM_Spindle_4","Hr 5"="NREM_Spindle_5"))
  DatDT<-rrt2$DT
  ArP<-rrt2$Arp
  ExtendDT<-rrt2$ExtendDT
  
  # Simple Effects:
  DatEfS<-list()
  for(is in 1:5) {
    DatEfS[[is]]<-ExData.2(nmF = NmFich,Vars = c(4:5,(8+is)))
    names(DatEfS[[is]]$DT)[3]<-"DepV"
  }
  
  names(rrt2$DT)[4:8]<-c("T1","T2","T3","T4","T5")
  ResGen<-AOVMx2.5(A=2,B=2,C=5,DatPas = rrt2,DatEfSp = DatEfS,nBMM1 = 10000,nBMM2 = 1000,Prc = 2)
  AlmacenGen2(GrpP = Grp,Grp2P = Grp2,DataPas = ResGen,PathDesignP = PathDesign, NmBasP = paste0(NmBas,"_TimeDetail"),Typ=2)
  
  # Other Graphs for Time details
    ExtendDT2<-rrt2$ExtendDT
    ExtendDTCol<-copy(ExtendDT2)
    ExtendDTCol$Moment<-"All"
    ExtendDTCol<-data.table(rbind(ExtendDT2,ExtendDTCol))
    
    Grp3<- Grph.3(DatP = ExtendDTCol,"OPR",LblsP =c("Spindle Characteristics", "","Spindle Count"),ylmP =c(0,500),hLin = F,lvIp = 6,wMain = T)
    
    GrpO<-Grph.3.Otros(ExtendDT,LblsP =c("Spindle Characteristics", "","Spindle Count"))
    
    pdf(paste0(NmFAlL,NmBas,"OtrosGraphs.pdf"))
      Grp3
      GrpO
    dev.off()
    
    #Results
    #AOV 1 Global
    ResGen1
    Kbl3(ResGen1[[1]], "Omnibus AOV. Design 2x2")
    Kbl3(ResGen1[[2]], "Simple Effects Age-Sleep. Design 2x2")
    Kbl3(ResGen1[[3]], "Extense Simple Effects Age-Sleep. Design 2x2")
    
    #AOV 2 For Time Details
        # Results
        plot(Grp)
        plot(Grp2) # Only this graph is printed in the html file.
        GrpO
        plot(Grp3)
        ResGen # Lean option to view the results of statistical analysis
        
        Kbl3(ResPas = ResGen[[1]], lbl = "Omnibus AOV. Design 2x2x(5xS)");cat("\n")
        Kbl3(ResGen[[2]], "Interaction Age-Sleep. Design 2x2x(5xS)")
        Kbl3(ResGen[[3]], "Interaction Age-Time. Design 2x2x(5xS)")
        Kbl3(ResGen[[4]], "Interaction Sleep-Time. Design 2x2x(5xS)")
        Kbl3(ResGen[[5]], "Main Effect Time. Design 2x2x(5xS)")
        Kbl3(ResGen[[6]], "Simple Effect Time each Age-Sleep condition. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[1]][[1]], "Simple Effect Age-Sleep on Time=1 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[1]][[2]], "Simple Effect Age-Sleep on Time=1 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[1]][[3]], "Simple Effect Age-Sleep on Time=1 Extense Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[2]][[1]], "Simple Effect Age-Sleep on Time=2 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[2]][[2]], "Simple Effect Age-Sleep on Time=2 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[2]][[3]], "Simple Effect Age-Sleep on Time=2 Extense Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[3]][[1]], "Simple Effect Age-Sleep on Time=3 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[3]][[2]], "Simple Effect Age-Sleep on Time=3 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[3]][[3]], "Simple Effect Age-Sleep on Time=3 Extense Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[4]][[1]], "Simple Effect Age-Sleep on Time=4 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[4]][[2]], "Simple Effect Age-Sleep on Time=4 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[4]][[3]], "Simple Effect Age-Sleep on Time=4 Extense Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[5]][[1]], "Simple Effect Age-Sleep on Time=5 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[5]][[2]], "Simple Effect Age-Sleep on Time=5 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[5]][[3]], "Simple Effect Age-Sleep on Time=5 Extense Simple Effects. Design 2x2x(5xS)")
[1] "Taking bootstrap samples. Please wait."
          Eff   p.V1 p.Sig
1:  A.p.value 0.0835      
2:  B.p.value 0.0818      
3: AB.p.value     NA      
[1] "Taking bootstrap samples. Please wait."
          Eff   p.V1 p.Sig
1:  A.p.value 0.0693      
2:  B.p.value 0.0678      
3: AB.p.value 0.0202 *    
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
           Eff   p.V1 p.Sig
1:   p.value.A 0.3055      
2:   p.value.B 0.4674      
3:   p.value.C 0.0083 *    
4:  p.value.AB 0.0851      
5:  p.value.AC 0.1836      
6:  p.value.BC 0.8414      
7: p.value.ABC 0.6962      
           Eff   p.V1 p.Sig
1:   p.value.A 0.3086      
2:   p.value.B 0.4582      
3:   p.value.C 0.0005 *    
4:  p.value.AB 0.0000 *    
5:  p.value.AC 0.1109      
6:  p.value.BC 0.8338      
7: p.value.ABC 0.6310      
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
$BP

$Bars

$MargAB

$MargAC

$MargBC

$MargC

quartz_off_screen 
                2 
$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 3.59 0.075   3.59  0.075  2.17 0.1502 0.0835       0.0693       
2:     Sleep 3.47 0.080   3.47  0.080  2.07 0.1598 0.0818       0.0678       
3: Age*Sleep 6.50 0.020  -0.30  0.110  2.70 0.1101     NA       0.0202  *    
   EffSize
1:    0.33
2:    0.27
3:    0.61

$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   4.53  7.80  0.46  0.6557      0.14      0.21 0.6278
2:   Sleep on Old -29.10  8.85 -3.29  0.0096      0.58     10.81 0.0044
3: Age on Control   4.31 10.83  0.37  0.7188      0.09      0.14 0.7089
4:      Age on SR -29.32  9.37 -4.77  0.0009      0.75     22.75 0.0000
   EffSize.Boot
1:         0.14
2:         0.58
3:         0.11
4:         0.73

$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   4.53  7.80  0.46  0.6557      0.14      0.21 0.6303
2:   Sleep on Old -29.10  8.85 -3.29  0.0096      0.57     10.81 0.0100
3: Age on Control   4.31 10.83  0.37  0.7188      0.10      0.14 0.7144
4:      Age on SR -29.32  9.37 -4.77  0.0009      0.75     22.75 0.0000
5:      YSR vs OC  -0.22  7.33 -0.03  0.9792      0.11      0.00 0.9822
   EffSize.Boot
1:         0.14
2:         0.59
3:         0.11
4:         0.75
5:         0.09
Omnibus AOV. Design 2x2
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 3.59 0.075 3.59 0.075 2.17 0.1502 0.0835 0.0693 0.33
Sleep 3.47 0.080 3.47 0.080 2.07 0.1598 0.0818 0.0678 0.27
Age*Sleep 6.50 0.020 -0.30 0.110 2.70 0.1101 NA 0.0202
0.61
Simple Effects Age-Sleep. Design 2x2
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 4.53 7.80 0.46 0.6557 0.14 0.21 0.6278 0.14
Sleep on Old -29.10 8.85 -3.29 0.0096 0.58 10.81 0.0044 0.58
Age on Control 4.31 10.83 0.37 0.7188 0.09 0.14 0.7089 0.11
Age on SR -29.32 9.37 -4.77 0.0009 0.75 22.75 0.0000 0.73
Extense Simple Effects Age-Sleep. Design 2x2
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 4.53 7.80 0.46 0.6557 0.14 0.21 0.6303 0.14
Sleep on Old -29.10 8.85 -3.29 0.0096 0.57 10.81 0.0100 0.59
Age on Control 4.31 10.83 0.37 0.7188 0.10 0.14 0.7144 0.11
Age on SR -29.32 9.37 -4.77 0.0009 0.75 22.75 0.0000 0.75
YSR vs OC -0.22 7.33 -0.03 0.9792 0.11 0.00 0.9822 0.09
$BP

$Bars

$MargAB

$MargAC

$MargBC

$MargC

$AOV
            Names    Q      p  pBoot   Sig pBootMas  Sig2
1:            Age 1.06 0.3042 0.3055         0.3086      
2:          Sleep 0.55 0.4567 0.4674         0.4582      
3:           Time 0.90 0.4654 0.0083 *       0.0005 *    
4:      Age*Sleep 3.04 0.0814 0.0851         0.0000 *    
5:       Age*Time 0.23 0.9237 0.1836         0.1109      
6:     Sleep*Time 0.04 0.9973 0.8414         0.8338      
7: Age*Sleep*Time 0.07 0.9917 0.6962         0.6310      

$InterAB
            Contr  psihat    df  test p.value EfSize.V1
1: Sleep on Young   33.24 37.64  0.43  0.6683      0.14
2:   Sleep on Old -127.50 30.19 -1.39  0.1752      0.59
3: Age on Control   20.31 34.13  0.21  0.8314      0.13
4:      Age on SR -140.43 31.17 -1.91  0.0651      0.73

$InterAC
             Contr  psihat    df  test p.value EfSize.V1
 1:      Age on M1  -40.45 20.96 -0.95  0.3523      0.24
 2:      Age on M2  -86.95 14.56 -1.56  0.1407      0.32
 3:      Age on M3   16.98 11.05  0.30  0.7675      0.09
 4:      Age on M4   79.88  8.23  1.56  0.1552      0.40
 5:      Age on M5  -89.57 18.17 -1.47  0.1575      0.39
 6: M1-M2 on Young   86.50    NA  1.29  0.2546      0.23
 7:   M1-M2 on Old   69.33    NA  0.95  0.3837      0.11
 8: M2-M3 on Young   18.00    NA  0.21  0.8418      0.23
 9:   M2-M3 on Old  112.50    NA  1.17  0.2961      0.45
10: M3-M4 on Young   55.17    NA  0.74  0.4903      0.19
11:   M3-M4 on Old   66.00    NA  0.74  0.4899      0.45
12: M4-M5 on Young   19.50    NA  0.52  0.6278      0.18
13:   M4-M5 on Old -130.17    NA -1.99  0.1026      0.51

$InterBC
             Contr psihat    df  test p.value EfSize.V1
 1:    Sleep on M1 -15.88 20.96 -0.37  0.7125      0.04
 2:    Sleep on M2 -38.81 14.56 -0.70  0.4978      0.15
 3:    Sleep on M3 -85.60 11.05 -1.53  0.1546      0.34
 4:    Sleep on M4  24.79  8.23  0.49  0.6400      0.16
 5:    Sleep on M5  21.24 18.17  0.35  0.7307      0.15
 6: M1-M2 on Young 104.83    NA  1.24  0.2687      0.29
 7:   M1-M2 on Old  86.50    NA  0.94  0.3909      0.12
 8: M2-M3 on Young  87.33    NA  0.76  0.4797      0.34
 9:   M2-M3 on Old  64.50    NA  0.86  0.4267      0.34
10: M3-M4 on Young  14.33    NA  0.12  0.9056      0.05
11:   M3-M4 on Old 130.33    NA  3.61  0.0155      0.60
12: M4-M5 on Young -58.00    NA -0.69  0.5203      0.15
13:   M4-M5 on Old -48.83    NA -0.80  0.4626      0.14

$DetallMainC
   Contr psihat  test p.value Psihat2 p.value2 EfSize.V1
1: M1-M2 169.83  2.31  0.0689   89.50    0.104      0.19
2: M2-M3  98.33  0.93  0.3929  193.07    0.004      0.34
3: M3-M4 109.67  0.90  0.4093  114.43    0.196      0.31
4: M4-M5 -97.67 -3.05  0.0284  -95.55    0.080      0.17

$DetallTrialCadaCondAB
            Contr psihat df  test p.value Psihat2 p.value2 dif.yuen df.yuen
 1:  M1-M2 on Y_C  86.00 NA  1.12  0.3144   51.71    0.376    51.71       6
 2: M1-M2 on Y_SR  25.17 NA  0.59  0.5794   16.29    0.652    16.29       6
 3:  M1-M2 on O_C  19.17 NA  0.41  0.6982    4.50    0.672     4.50       5
 4: M1-M2 on O_SR  32.33 NA  0.51  0.6347   17.00    0.688    17.00       5
 5:  M2-M3 on Y_C -18.17 NA -0.16  0.8754   -1.57    0.966    -1.57       6
 6: M2-M3 on Y_SR  41.67 NA  1.51  0.1921   46.14    0.128    46.14       6
 7:  M2-M3 on O_C 102.67 NA  1.59  0.1725  121.50    0.000   121.50       5
 8: M2-M3 on O_SR  40.50 NA  1.29  0.2535   27.00    0.428    27.00       5
 9:  M3-M4 on Y_C  16.83 NA  0.31  0.7725    8.19    0.840    19.67       5
10: M3-M4 on Y_SR  32.33 NA  0.99  0.3683   17.57    0.288    17.57       6
11:  M3-M4 on O_C  -2.67 NA -0.03  0.9793   -6.17    0.930    -6.17       5
12: M3-M4 on O_SR  89.33 NA  3.54  0.0165   94.83    0.004    88.67       5
13:  M4-M5 on Y_C  10.33 NA  0.22  0.8362    7.67    0.806     7.67       5
14: M4-M5 on Y_SR  11.50 NA  0.24  0.8163   29.29    0.414    29.29       6
15:  M4-M5 on O_C -61.83 NA -1.78  0.1350  -53.67    0.176   -53.67       5
16: M4-M5 on O_SR -64.33 NA -1.17  0.2960  -78.83    0.052   -78.83       5
    test.yuen EffSize.yuen pvaluet.yuen
 1:      0.97         0.37       0.3682
 2:      0.52         0.17       0.6211
 3:      0.19         0.09       0.8562
 4:      0.37         0.13       0.7279
 5:     -0.02         0.01       0.9809
 6:      1.93         0.46       0.1020
 7:      2.59         0.80       0.0487
 8:      0.84         0.26       0.4368
 9:      0.65         0.08       0.5441
10:      1.16         0.32       0.2919
11:     -0.08         0.03       0.9408
12:      3.74         0.78       0.0134
13:      0.21         0.09       0.8386
14:      0.90         0.31       0.4038
15:     -1.24         0.35       0.2696
16:     -1.95         0.55       0.1090

$DetallSimple
$DetallSimple[[1]]
$DetallSimple[[1]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 0.91 0.352   0.91  0.352  1.10 0.3006 0.3589        0.341       
2:     Sleep 0.14 0.713   0.14  0.713  0.01 0.9305 0.7179        0.692       
3: Age*Sleep 0.09 0.773  -0.02  0.920  0.07 0.7992 0.8831        0.783       
   EffSize
1:    0.23
2:    0.04
3:    0.11

$DetallSimple[[1]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -1.71 11.82 -0.06  0.9535      0.02      0.00 0.9522
2:   Sleep on Old -14.17  9.80 -0.45  0.6607      0.15      0.20 0.6811
3: Age on Control -14.00 10.98 -0.47  0.6471      0.24      0.22 0.6689
4:      Age on SR -26.45 10.06 -0.87  0.4043      0.34      0.76 0.3956
   EffSize.Boot
1:         0.02
2:         0.15
3:         0.21
4:         0.28

$DetallSimple[[1]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -1.71 11.82 -0.06  0.9535      0.02      0.00 0.9499
2:   Sleep on Old -14.17  9.80 -0.45  0.6607      0.15      0.20 0.6667
3: Age on Control -14.00 10.98 -0.47  0.6471      0.18      0.22 0.6900
4:      Age on SR -26.45 10.06 -0.87  0.4043      0.36      0.76 0.3911
5:      YSR vs OC -12.29 10.71 -0.44  0.6694      0.18      0.19 0.6930
   EffSize.Boot
1:         0.02
2:         0.17
3:         0.19
4:         0.31
5:         0.15


$DetallSimple[[2]]
$DetallSimple[[2]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 2.43 0.140   2.43  0.140  2.06 0.1603 0.1636        0.139       
2:     Sleep 0.48 0.498   0.48  0.498  0.52 0.4746 0.5142        0.490       
3: Age*Sleep 0.40 0.535   0.04  0.830  0.13 0.7191     NA        0.525       
   EffSize
1:    0.32
2:    0.16
3:    0.21

$DetallSimple[[2]]$Detall
            Contr psihat   df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young -37.14 8.97 -0.84  0.4218      0.28      0.71 0.4178
2:   Sleep on Old  -1.67 5.60 -0.05  0.9628      0.06      0.00 0.9656
3: Age on Control -61.21 6.52 -1.53  0.1737      0.46      2.33 0.1646
4:      Age on SR -25.74 8.42 -0.66  0.5253      0.22      0.44 0.5100
   EffSize.Boot
1:         0.28
2:         0.08
3:         0.47
4:         0.22

$DetallSimple[[2]]$DetallExt
            Contr psihat   df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young -37.14 8.97 -0.84  0.4218      0.28      0.71 0.3956
2:   Sleep on Old  -1.67 5.60 -0.05  0.9628      0.06      0.00 0.9667
3: Age on Control -61.21 6.52 -1.53  0.1737      0.46      2.33 0.1591
4:      Age on SR -25.74 8.42 -0.66  0.5253      0.27      0.44 0.5344
5:      YSR vs OC -24.07 7.87 -1.11  0.3014      0.37      1.22 0.3215
   EffSize.Boot
1:         0.28
2:         0.09
3:         0.45
4:         0.21
5:         0.38


$DetallSimple[[3]]
$DetallSimple[[3]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 0.09 0.768   0.09  0.768  0.01 0.9407 0.7195        0.756       
2:     Sleep 2.33 0.153   2.33  0.153  2.28 0.1424 0.1436        0.157       
3: Age*Sleep 3.63 0.080  -0.28  0.140  3.41 0.0760     NA        0.082       
   EffSize
1:    0.08
2:    0.34
3:    0.56

$DetallSimple[[3]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  10.57  7.65  0.31  0.7684      0.10      0.09 0.7544
2:   Sleep on Old -96.17  5.34 -2.18  0.0771      0.78      4.77 0.1069
3: Age on Control  61.86  9.66  1.14  0.2804      0.36      1.31 0.2689
4:      Age on SR -44.88 10.08 -3.09  0.0114      0.71      9.52 0.0123
   EffSize.Boot
1:         0.10
2:         0.79
3:         0.35
4:         0.71

$DetallSimple[[3]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  10.57  7.65  0.31  0.7684      0.10      0.09 0.7820
2:   Sleep on Old -96.17  5.34 -2.18  0.0771      0.81      4.77 0.1196
3: Age on Control  61.86  9.66  1.14  0.2804      0.34      1.31 0.2422
4:      Age on SR -44.88 10.08 -3.09  0.0114      0.71      9.52 0.0056
5:      YSR vs OC  51.29  5.79  1.14  0.2989      0.51      1.30 0.3059
   EffSize.Boot
1:         0.10
2:         0.79
3:         0.36
4:         0.71
5:         0.51


$DetallSimple[[4]]
$DetallSimple[[4]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1 pBoot Sig pBootMas SigMas
1:       Age 2.45 0.151   2.45  0.151  1.09 0.3072    NA            1       
2:     Sleep 0.24 0.640   0.24  0.640  0.05 0.8199    NA            0  *    
3: Age*Sleep 0.09 0.775  -0.21  0.330  1.21 0.2838    NA            0  *    
   EffSize
1:    0.40
2:    0.15
3:    0.21

$DetallSimple[[4]]$Detall
            Contr psihat    df test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  19.95 10.12 1.19  0.2600      0.37      1.42 0.2722
2:   Sleep on Old   4.83  6.62 0.10  0.9231      0.03      0.01 0.9031
3: Age on Control  47.50  5.84 1.02  0.3475      0.31      1.04 0.3103
4:      Age on SR  32.38  8.16 1.54  0.1618      0.49      2.37 0.1750
   EffSize.Boot
1:         0.37
2:         0.03
3:         0.31
4:         0.48

$DetallSimple[[4]]$DetallExt
            Contr psihat    df test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  19.95 10.12 1.19  0.2600      0.37      1.42 0.2647
2:   Sleep on Old   4.83  6.62 0.10  0.9231      0.03      0.01 0.9053
3: Age on Control  47.50  5.84 1.02  0.3475      0.32      1.04 0.3222
4:      Age on SR  32.38  8.16 1.54  0.1618      0.47      2.37 0.1451
5:      YSR vs OC  27.55  5.56 0.60  0.5719      0.22      0.36 0.5322
   EffSize.Boot
1:         0.37
2:         0.03
3:         0.32
4:         0.48
5:         0.21


$DetallSimple[[5]]
$DetallSimple[[5]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1 pBoot Sig pBootMas SigMas
1:       Age 2.17 0.157   2.17  0.157  3.92 0.0558    NA            1       
2:     Sleep 0.12 0.731   0.12  0.731  0.03 0.8542    NA            0  *    
3: Age*Sleep 1.04 0.322  -0.18  0.390  2.70 0.1095    NA            0  *    
   EffSize
1:    0.39
2:    0.16
3:    0.33

$DetallSimple[[5]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  41.57 10.91  1.02  0.3308      0.32      1.04 0.3411
2:   Sleep on Old -20.33  8.27 -0.45  0.6628      0.17      0.20 0.6396
3: Age on Control -13.83  9.59 -0.37  0.7181      0.18      0.14 0.7089
4:      Age on SR -75.74  9.68 -1.58  0.1469      0.49      2.49 0.1559
   EffSize.Boot
1:         0.33
2:         0.17
3:         0.16
4:         0.45

$DetallSimple[[5]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  41.57 10.91  1.02  0.3308      0.32      1.04 0.3433
2:   Sleep on Old -20.33  8.27 -0.45  0.6628      0.17      0.20 0.6674
3: Age on Control -13.83  9.59 -0.37  0.7181      0.18      0.14 0.6944
4:      Age on SR -75.74  9.68 -1.58  0.1469      0.46      2.49 0.1680
5:      YSR vs OC -55.40 10.86 -1.49  0.1646      0.50      2.22 0.1635
   EffSize.Boot
1:         0.32
2:         0.17
3:         0.15
4:         0.45
5:         0.53
Omnibus AOV. Design 2x2x(5xS)
Names Q p pBoot Sig pBootMas Sig2
Age 1.06 0.3042 0.3055 0.3086
Sleep 0.55 0.4567 0.4674 0.4582
Time 0.90 0.4654 0.0083
0.0005
Age*Sleep 3.04 0.0814 0.0851 0.0000
Age*Time 0.23 0.9237 0.1836 0.1109
Sleep*Time 0.04 0.9973 0.8414 0.8338
AgeSleepTime 0.07 0.9917 0.6962 0.6310
Interaction Age-Sleep. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1
Sleep on Young 33.24 37.64 0.43 0.6683 0.14
Sleep on Old -127.50 30.19 -1.39 0.1752 0.59
Age on Control 20.31 34.13 0.21 0.8314 0.13
Age on SR -140.43 31.17 -1.91 0.0651 0.73
Interaction Age-Time. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1
Age on M1 -40.45 20.96 -0.95 0.3523 0.24
Age on M2 -86.95 14.56 -1.56 0.1407 0.32
Age on M3 16.98 11.05 0.30 0.7675 0.09
Age on M4 79.88 8.23 1.56 0.1552 0.40
Age on M5 -89.57 18.17 -1.47 0.1575 0.39
M1-M2 on Young 86.50 NA 1.29 0.2546 0.23
M1-M2 on Old 69.33 NA 0.95 0.3837 0.11
M2-M3 on Young 18.00 NA 0.21 0.8418 0.23
M2-M3 on Old 112.50 NA 1.17 0.2961 0.45
M3-M4 on Young 55.17 NA 0.74 0.4903 0.19
M3-M4 on Old 66.00 NA 0.74 0.4899 0.45
M4-M5 on Young 19.50 NA 0.52 0.6278 0.18
M4-M5 on Old -130.17 NA -1.99 0.1026 0.51
Interaction Sleep-Time. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1
Sleep on M1 -15.88 20.96 -0.37 0.7125 0.04
Sleep on M2 -38.81 14.56 -0.70 0.4978 0.15
Sleep on M3 -85.60 11.05 -1.53 0.1546 0.34
Sleep on M4 24.79 8.23 0.49 0.6400 0.16
Sleep on M5 21.24 18.17 0.35 0.7307 0.15
M1-M2 on Young 104.83 NA 1.24 0.2687 0.29
M1-M2 on Old 86.50 NA 0.94 0.3909 0.12
M2-M3 on Young 87.33 NA 0.76 0.4797 0.34
M2-M3 on Old 64.50 NA 0.86 0.4267 0.34
M3-M4 on Young 14.33 NA 0.12 0.9056 0.05
M3-M4 on Old 130.33 NA 3.61 0.0155 0.60
M4-M5 on Young -58.00 NA -0.69 0.5203 0.15
M4-M5 on Old -48.83 NA -0.80 0.4626 0.14
Main Effect Time. Design 2x2x(5xS)
Contr psihat test p.value Psihat2 p.value2 EfSize.V1
M1-M2 169.83 2.31 0.0689 89.50 0.104 0.19
M2-M3 98.33 0.93 0.3929 193.07 0.004 0.34
M3-M4 109.67 0.90 0.4093 114.43 0.196 0.31
M4-M5 -97.67 -3.05 0.0284 -95.55 0.080 0.17
Simple Effect Time each Age-Sleep condition. Design 2x2x(5xS)
Contr psihat df test p.value Psihat2 p.value2 dif.yuen df.yuen test.yuen EffSize.yuen pvaluet.yuen
M1-M2 on Y_C 86.00 NA 1.12 0.3144 51.71 0.376 51.71 6 0.97 0.37 0.3682
M1-M2 on Y_SR 25.17 NA 0.59 0.5794 16.29 0.652 16.29 6 0.52 0.17 0.6211
M1-M2 on O_C 19.17 NA 0.41 0.6982 4.50 0.672 4.50 5 0.19 0.09 0.8562
M1-M2 on O_SR 32.33 NA 0.51 0.6347 17.00 0.688 17.00 5 0.37 0.13 0.7279
M2-M3 on Y_C -18.17 NA -0.16 0.8754 -1.57 0.966 -1.57 6 -0.02 0.01 0.9809
M2-M3 on Y_SR 41.67 NA 1.51 0.1921 46.14 0.128 46.14 6 1.93 0.46 0.1020
M2-M3 on O_C 102.67 NA 1.59 0.1725 121.50 0.000 121.50 5 2.59 0.80 0.0487
M2-M3 on O_SR 40.50 NA 1.29 0.2535 27.00 0.428 27.00 5 0.84 0.26 0.4368
M3-M4 on Y_C 16.83 NA 0.31 0.7725 8.19 0.840 19.67 5 0.65 0.08 0.5441
M3-M4 on Y_SR 32.33 NA 0.99 0.3683 17.57 0.288 17.57 6 1.16 0.32 0.2919
M3-M4 on O_C -2.67 NA -0.03 0.9793 -6.17 0.930 -6.17 5 -0.08 0.03 0.9408
M3-M4 on O_SR 89.33 NA 3.54 0.0165 94.83 0.004 88.67 5 3.74 0.78 0.0134
M4-M5 on Y_C 10.33 NA 0.22 0.8362 7.67 0.806 7.67 5 0.21 0.09 0.8386
M4-M5 on Y_SR 11.50 NA 0.24 0.8163 29.29 0.414 29.29 6 0.90 0.31 0.4038
M4-M5 on O_C -61.83 NA -1.78 0.1350 -53.67 0.176 -53.67 5 -1.24 0.35 0.2696
M4-M5 on O_SR -64.33 NA -1.17 0.2960 -78.83 0.052 -78.83 5 -1.95 0.55 0.1090
Simple Effect Age-Sleep on Time=1 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.91 0.352 0.91 0.352 1.10 0.3006 0.3589 0.341 0.23
Sleep 0.14 0.713 0.14 0.713 0.01 0.9305 0.7179 0.692 0.04
Age*Sleep 0.09 0.773 -0.02 0.920 0.07 0.7992 0.8831 0.783 0.11
Simple Effect Age-Sleep on Time=1 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -1.71 11.82 -0.06 0.9535 0.02 0.00 0.9522 0.02
Sleep on Old -14.17 9.80 -0.45 0.6607 0.15 0.20 0.6811 0.15
Age on Control -14.00 10.98 -0.47 0.6471 0.24 0.22 0.6689 0.21
Age on SR -26.45 10.06 -0.87 0.4043 0.34 0.76 0.3956 0.28
Simple Effect Age-Sleep on Time=1 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -1.71 11.82 -0.06 0.9535 0.02 0.00 0.9499 0.02
Sleep on Old -14.17 9.80 -0.45 0.6607 0.15 0.20 0.6667 0.17
Age on Control -14.00 10.98 -0.47 0.6471 0.18 0.22 0.6900 0.19
Age on SR -26.45 10.06 -0.87 0.4043 0.36 0.76 0.3911 0.31
YSR vs OC -12.29 10.71 -0.44 0.6694 0.18 0.19 0.6930 0.15
Simple Effect Age-Sleep on Time=2 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 2.43 0.140 2.43 0.140 2.06 0.1603 0.1636 0.139 0.32
Sleep 0.48 0.498 0.48 0.498 0.52 0.4746 0.5142 0.490 0.16
Age*Sleep 0.40 0.535 0.04 0.830 0.13 0.7191 NA 0.525 0.21
Simple Effect Age-Sleep on Time=2 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -37.14 8.97 -0.84 0.4218 0.28 0.71 0.4178 0.28
Sleep on Old -1.67 5.60 -0.05 0.9628 0.06 0.00 0.9656 0.08
Age on Control -61.21 6.52 -1.53 0.1737 0.46 2.33 0.1646 0.47
Age on SR -25.74 8.42 -0.66 0.5253 0.22 0.44 0.5100 0.22
Simple Effect Age-Sleep on Time=2 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -37.14 8.97 -0.84 0.4218 0.28 0.71 0.3956 0.28
Sleep on Old -1.67 5.60 -0.05 0.9628 0.06 0.00 0.9667 0.09
Age on Control -61.21 6.52 -1.53 0.1737 0.46 2.33 0.1591 0.45
Age on SR -25.74 8.42 -0.66 0.5253 0.27 0.44 0.5344 0.21
YSR vs OC -24.07 7.87 -1.11 0.3014 0.37 1.22 0.3215 0.38
Simple Effect Age-Sleep on Time=3 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.09 0.768 0.09 0.768 0.01 0.9407 0.7195 0.756 0.08
Sleep 2.33 0.153 2.33 0.153 2.28 0.1424 0.1436 0.157 0.34
Age*Sleep 3.63 0.080 -0.28 0.140 3.41 0.0760 NA 0.082 0.56
Simple Effect Age-Sleep on Time=3 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 10.57 7.65 0.31 0.7684 0.10 0.09 0.7544 0.10
Sleep on Old -96.17 5.34 -2.18 0.0771 0.78 4.77 0.1069 0.79
Age on Control 61.86 9.66 1.14 0.2804 0.36 1.31 0.2689 0.35
Age on SR -44.88 10.08 -3.09 0.0114 0.71 9.52 0.0123 0.71
Simple Effect Age-Sleep on Time=3 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 10.57 7.65 0.31 0.7684 0.10 0.09 0.7820 0.10
Sleep on Old -96.17 5.34 -2.18 0.0771 0.81 4.77 0.1196 0.79
Age on Control 61.86 9.66 1.14 0.2804 0.34 1.31 0.2422 0.36
Age on SR -44.88 10.08 -3.09 0.0114 0.71 9.52 0.0056 0.71
YSR vs OC 51.29 5.79 1.14 0.2989 0.51 1.30 0.3059 0.51
Simple Effect Age-Sleep on Time=4 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 2.45 0.151 2.45 0.151 1.09 0.3072 NA 1 0.40
Sleep 0.24 0.640 0.24 0.640 0.05 0.8199 NA 0
0.15
Age*Sleep 0.09 0.775 -0.21 0.330 1.21 0.2838 NA 0
0.21
Simple Effect Age-Sleep on Time=4 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 19.95 10.12 1.19 0.2600 0.37 1.42 0.2722 0.37
Sleep on Old 4.83 6.62 0.10 0.9231 0.03 0.01 0.9031 0.03
Age on Control 47.50 5.84 1.02 0.3475 0.31 1.04 0.3103 0.31
Age on SR 32.38 8.16 1.54 0.1618 0.49 2.37 0.1750 0.48
Simple Effect Age-Sleep on Time=4 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 19.95 10.12 1.19 0.2600 0.37 1.42 0.2647 0.37
Sleep on Old 4.83 6.62 0.10 0.9231 0.03 0.01 0.9053 0.03
Age on Control 47.50 5.84 1.02 0.3475 0.32 1.04 0.3222 0.32
Age on SR 32.38 8.16 1.54 0.1618 0.47 2.37 0.1451 0.48
YSR vs OC 27.55 5.56 0.60 0.5719 0.22 0.36 0.5322 0.21
Simple Effect Age-Sleep on Time=5 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 2.17 0.157 2.17 0.157 3.92 0.0558 NA 1 0.39
Sleep 0.12 0.731 0.12 0.731 0.03 0.8542 NA 0
0.16
Age*Sleep 1.04 0.322 -0.18 0.390 2.70 0.1095 NA 0
0.33
Simple Effect Age-Sleep on Time=5 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 41.57 10.91 1.02 0.3308 0.32 1.04 0.3411 0.33
Sleep on Old -20.33 8.27 -0.45 0.6628 0.17 0.20 0.6396 0.17
Age on Control -13.83 9.59 -0.37 0.7181 0.18 0.14 0.7089 0.16
Age on SR -75.74 9.68 -1.58 0.1469 0.49 2.49 0.1559 0.45
Simple Effect Age-Sleep on Time=5 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 41.57 10.91 1.02 0.3308 0.32 1.04 0.3433 0.32
Sleep on Old -20.33 8.27 -0.45 0.6628 0.17 0.20 0.6674 0.17
Age on Control -13.83 9.59 -0.37 0.7181 0.18 0.14 0.6944 0.15
Age on SR -75.74 9.68 -1.58 0.1469 0.46 2.49 0.1680 0.45
YSR vs OC -55.40 10.86 -1.49 0.1646 0.50 2.22 0.1635 0.53

8.5 Fig 7F Duration during recovery {Design 2x2x((5+1)xS)

  NmBas="Fig7F AvgSpindDurat Recover"
  NmFich<-paste0(PathDesign,"DeltaTetaSpindleRecover.csv");
  NmFAlL<-paste0(PathDesign,NmBas)
  if (!dir.exists(NmFAlL)) {dir.create(NmFAlL)}
  NmFAlL<-paste0(NmFAlL,"/")
  ResGen<-NA;ResGen1<-NA;

  # Graphs Previously
  rrt<-ExDataIS.2(nmF = NmFich,Vars = ,c(4,5,7,15:20),vIntP =c(4:9),lvlCh = list("Hr 1"="Avg_SpindleDuration_NREM_1", "Hr 2"="Avg_SpindleDuration_NREM_2","Hr 3"="Avg_SpindleDuration_NREM_3","Hr 4"="Avg_SpindleDuration_NREM_4","Hr 5"="Avg_SpindleDuration_NREM_5","Total"="Avg_SpindleDuration_NREM_TT"))
  DatDT<-rrt$DT
  ArP<-rrt$Arp
  ExtendDT<-rrt$ExtendDT
  
  Grp<- Grph.3(DatP = ExtendDT,"OPR",LblsP =c("Spindle Characteristics", "","Spindle Duration (s)"),ylmP =c(0,3),hLin = F,lvIp = 6)
  Grp2=Grp
  
  #AOV 1 Global
  rrt<-ExData.2(nmF =NmFich,Vars = c(4,5,20))
  DatDT<-rrt$DT
  ArP<-rrt$Arp
  
  names(rrt$DT)[3]<-"DepV"
  ResGen1<-AOVBwF(2,2,DatPas = rrt,nBMM = 10000)
  AlmacenGen(Grp,Grp2,ResGen1,PathDesign,paste0(NmBas,"_Total"),Typ=1)
  
  #AOV 2 For Time Details
  rrt2<-ExDataIS.2(nmF = NmFich,Vars = c(4,5,7,15:19),vIntP =c(4:8),lvlCh = list("Hr 1"="Avg_SpindleDuration_NREM_1", "Hr 2"="Avg_SpindleDuration_NREM_2","Hr 3"="Avg_SpindleDuration_NREM_3","Hr 4"="Avg_SpindleDuration_NREM_4","Hr 5"="Avg_SpindleDuration_NREM_5"))
  DatDT<-rrt2$DT
  ArP<-rrt2$Arp
  ExtendDT<-rrt2$ExtendDT
  
  # Simple Effects:
  DatEfS<-list()
  for(is in 1:5) {
    DatEfS[[is]]<-ExData.2(nmF = NmFich,Vars = c(4:5,(8+is)))
    names(DatEfS[[is]]$DT)[3]<-"DepV"
  }
  
  names(rrt2$DT)[4:8]<-c("T1","T2","T3","T4","T5")
  ResGen<-AOVMx2.5(A=2,B=2,C=5,DatPas = rrt2,DatEfSp = DatEfS,nBMM1 = 10000,nBMM2 = 1000,Prc = 2)
  AlmacenGen2(GrpP = Grp,Grp2P = Grp2,DataPas = ResGen,PathDesignP = PathDesign,NmBasP = paste0(NmBas,"_TimeDetail"),Typ=2)
  
  # Other Graphs for Time details
    ExtendDT2<-rrt2$ExtendDT
    ExtendDTCol<-copy(ExtendDT2)
    ExtendDTCol$Moment<-"All"
    ExtendDTCol<-data.table(rbind(ExtendDT2,ExtendDTCol))
    
    Grp3<- Grph.3(DatP = ExtendDTCol,"OPR",LblsP =c("Spindle Characteristics", "","Spindle Duration (s)"),ylmP =c(0,3),hLin = F,lvIp = 6,wMain = T)
    
    GrpO<-Grph.3.Otros(ExtendDT,LblsP =c("Spindle Characteristics", "","Spindle Duration (s)"))
    
    pdf(paste0(NmFAlL,NmBas,"OtrosGraphs.pdf"))
      Grp3
      GrpO
    dev.off()
    
    #Results
    #AOV 1 Global
    ResGen1
    Kbl3(ResGen1[[1]], "Omnibus AOV. Design 2x2")
    Kbl3(ResGen1[[2]], "Simple Effects Age-Sleep. Design 2x2")
    Kbl3(ResGen1[[3]], "Extense Simple Effects Age-Sleep. Design 2x2")
    
    #AOV 2 For Time Details
        # Results
        plot(Grp)
        plot(Grp2) # Only this graph is printed in the html file.
        GrpO
        plot(Grp3)
        ResGen # Lean option to view the results of statistical analysis
        
        Kbl3(ResPas = ResGen[[1]], lbl = "Omnibus AOV. Design 2x2x(5xS)");cat("\n")
        Kbl3(ResGen[[2]], "Interaction Age-Sleep. Design 2x2x(5xS)")
        Kbl3(ResGen[[3]], "Interaction Age-Time. Design 2x2x(5xS)")
        Kbl3(ResGen[[4]], "Interaction Sleep-Time. Design 2x2x(5xS)")
        Kbl3(ResGen[[5]], "Main Effect Time. Design 2x2x(5xS)")
        Kbl3(ResGen[[6]], "Simple Effect Time each Age-Sleep condition. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[1]][[1]], "Simple Effect Age-Sleep on Time=1 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[1]][[2]], "Simple Effect Age-Sleep on Time=1 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[1]][[3]], "Simple Effect Age-Sleep on Time=1 Extense Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[2]][[1]], "Simple Effect Age-Sleep on Time=2 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[2]][[2]], "Simple Effect Age-Sleep on Time=2 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[2]][[3]], "Simple Effect Age-Sleep on Time=2 Extense Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[3]][[1]], "Simple Effect Age-Sleep on Time=3 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[3]][[2]], "Simple Effect Age-Sleep on Time=3 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[3]][[3]], "Simple Effect Age-Sleep on Time=3 Extense Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[4]][[1]], "Simple Effect Age-Sleep on Time=4 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[4]][[2]], "Simple Effect Age-Sleep on Time=4 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[4]][[3]], "Simple Effect Age-Sleep on Time=4 Extense Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[5]][[1]], "Simple Effect Age-Sleep on Time=5 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[5]][[2]], "Simple Effect Age-Sleep on Time=5 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[5]][[3]], "Simple Effect Age-Sleep on Time=5 Extense Simple Effects. Design 2x2x(5xS)")
[1] "Taking bootstrap samples. Please wait."
          Eff   p.V1 p.Sig
1:  A.p.value 0.6277      
2:  B.p.value 0.6093      
3: AB.p.value 0.7713      
[1] "Taking bootstrap samples. Please wait."
          Eff   p.V1 p.Sig
1:  A.p.value 0.6413      
2:  B.p.value 0.5824      
3: AB.p.value 0.6576      
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
           Eff   p.V1 p.Sig
1:   p.value.A 0.5209      
2:   p.value.B 0.9800      
3:   p.value.C 0.0401 *    
4:  p.value.AB 0.2705      
5:  p.value.AC 0.4057      
6:  p.value.BC 0.1035      
7: p.value.ABC 0.5676      
           Eff   p.V1 p.Sig
1:   p.value.A 0.5387      
2:   p.value.B 0.9714      
3:   p.value.C 0.0292 *    
4:  p.value.AB 0.0000 *    
5:  p.value.AC 0.4246      
6:  p.value.BC 0.0834      
7: p.value.ABC 0.6005      
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
$BP

$Bars

$MargAB

$MargAC

$MargBC

$MargC

quartz_off_screen 
                2 
$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 0.22 0.643   0.22  0.643  0.10 0.7495 0.6277       0.6413       
2:     Sleep 0.30 0.591   0.30  0.591  0.09 0.7698 0.6093       0.5824       
3: Age*Sleep 0.20 0.658  -0.12  0.540  0.37 0.5487 0.7713       0.6576       
   EffSize
1:    0.07
2:    0.09
3:    0.25

$Detall
            Contr psihat   df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.00 8.86 -0.09  0.9301      0.03      0.01 0.9300
2:   Sleep on Old  -0.05 8.62 -0.59  0.5673      0.26      0.35 0.5533
3: Age on Control   0.00 7.65 -0.02  0.9839      0.08      0.00 0.9822
4:      Age on SR  -0.04 9.11 -0.54  0.6003      0.20      0.29 0.6222
   EffSize.Boot
1:         0.03
2:         0.23
3:         0.12
4:         0.18

$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.00  8.86 -0.09  0.9301      0.03      0.01 0.9378
2:   Sleep on Old  -0.05  8.62 -0.59  0.5673      0.27      0.35 0.5467
3: Age on Control   0.00  7.65 -0.02  0.9839      0.13      0.00 0.9800
4:      Age on SR  -0.04  9.11 -0.54  0.6003      0.18      0.29 0.5889
5:      YSR vs OC   0.00 10.97  0.06  0.9559      0.15      0.00 0.9555
   EffSize.Boot
1:         0.03
2:         0.24
3:         0.12
4:         0.17
5:         0.21
Omnibus AOV. Design 2x2
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.22 0.643 0.22 0.643 0.10 0.7495 0.6277 0.6413 0.07
Sleep 0.30 0.591 0.30 0.591 0.09 0.7698 0.6093 0.5824 0.09
Age*Sleep 0.20 0.658 -0.12 0.540 0.37 0.5487 0.7713 0.6576 0.25
Simple Effects Age-Sleep. Design 2x2
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.00 8.86 -0.09 0.9301 0.03 0.01 0.9300 0.03
Sleep on Old -0.05 8.62 -0.59 0.5673 0.26 0.35 0.5533 0.23
Age on Control 0.00 7.65 -0.02 0.9839 0.08 0.00 0.9822 0.12
Age on SR -0.04 9.11 -0.54 0.6003 0.20 0.29 0.6222 0.18
Extense Simple Effects Age-Sleep. Design 2x2
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.00 8.86 -0.09 0.9301 0.03 0.01 0.9378 0.03
Sleep on Old -0.05 8.62 -0.59 0.5673 0.27 0.35 0.5467 0.24
Age on Control 0.00 7.65 -0.02 0.9839 0.13 0.00 0.9800 0.12
Age on SR -0.04 9.11 -0.54 0.6003 0.18 0.29 0.5889 0.17
YSR vs OC 0.00 10.97 0.06 0.9559 0.15 0.00 0.9555 0.21
$BP

$Bars

$MargAB

$MargAC

$MargBC

$MargC

$AOV
            Names    Q      p  pBoot   Sig pBootMas  Sig2
1:            Age 0.37 0.5423 0.5209         0.5387      
2:          Sleep 0.00 0.9739 0.9800         0.9714      
3:           Time 0.37 0.8322 0.0401 *       0.0292 *    
4:      Age*Sleep 1.30 0.2549 0.2705         0.0000 *    
5:       Age*Time 0.12 0.9768 0.4057         0.4246      
6:     Sleep*Time 0.26 0.9009 0.1035         0.0834      
7: Age*Sleep*Time 0.08 0.9877 0.5676         0.6005      

$InterAB
            Contr psihat    df  test p.value EfSize.V1
1: Sleep on Young   0.28 41.16  1.17  0.2483      0.03
2:   Sleep on Old  -0.18 35.53 -0.74  0.4619      0.23
3: Age on Control   0.13 40.55  0.59  0.5612      0.10
4:      Age on SR  -0.34 39.03 -1.27  0.2120      0.22

$InterAC
             Contr psihat    df  test p.value EfSize.V1
 1:      Age on M1   0.08 14.20  0.50  0.6221      0.13
 2:      Age on M2   0.07 18.86  0.58  0.5683      0.13
 3:      Age on M3   0.03 17.48  0.22  0.8249      0.05
 4:      Age on M4  -0.05 17.97 -0.30  0.7642      0.08
 5:      Age on M5  -0.34 16.23 -1.88  0.0780      0.45
 6: M1-M2 on Young  -0.03    NA -0.14  0.8904      0.12
 7:   M1-M2 on Old   0.09    NA  2.12  0.0874      0.11
 8: M2-M3 on Young   0.23    NA  2.27  0.0722      0.41
 9:   M2-M3 on Old   0.17    NA  1.01  0.3570      0.34
10: M3-M4 on Young  -0.20    NA -1.23  0.2720      0.42
11:   M3-M4 on Old  -0.30    NA -1.46  0.2045      0.40
12: M4-M5 on Young   0.11    NA  0.61  0.5693      0.37
13:   M4-M5 on Old  -0.07    NA -0.98  0.3725      0.05

$InterBC
             Contr psihat    df  test p.value EfSize.V1
 1:    Sleep on M1  -0.06 14.20 -0.35  0.7290      0.21
 2:    Sleep on M2  -0.21 18.86 -1.85  0.0798      0.43
 3:    Sleep on M3  -0.09 17.48 -0.59  0.5606      0.07
 4:    Sleep on M4   0.13 17.97  0.86  0.3997      0.19
 5:    Sleep on M5   0.33 16.23  1.80  0.0906      0.50
 6: M1-M2 on Young   0.08    NA  0.58  0.5881      0.26
 7:   M1-M2 on Old   0.04    NA  0.24  0.8173      0.05
 8: M2-M3 on Young   0.12    NA  0.66  0.5388      0.21
 9:   M2-M3 on Old   0.21    NA  2.01  0.1006      0.59
10: M3-M4 on Young  -0.30    NA -1.07  0.3324      0.57
11:   M3-M4 on Old  -0.03    NA -0.39  0.7108      0.27
12: M4-M5 on Young  -0.11    NA -0.88  0.4184      0.00
13:   M4-M5 on Old   0.06    NA  0.27  0.7968      0.39

$DetallMainC
   Contr psihat  test p.value Psihat2 p.value2 EfSize.V1
1: M1-M2   0.09  0.31  0.7657    0.15    0.476      0.12
2: M2-M3   0.30  2.23  0.0758    0.42    0.052      0.39
3: M3-M4  -0.39 -1.40  0.2200   -0.56    0.020      0.42
4: M4-M5   0.13  0.36  0.7305    0.28    0.092      0.21

$DetallTrialCadaCondAB
            Contr psihat df  test p.value Psihat2 p.value2 dif.yuen df.yuen
 1:  M1-M2 on Y_C   0.01 NA  0.11  0.9168    0.04    0.668     0.04       6
 2: M1-M2 on Y_SR   0.04 NA  0.21  0.8442    0.04    0.736     0.04       6
 3:  M1-M2 on O_C   0.06 NA  1.90  0.1152    0.11    0.004     0.11       5
 4: M1-M2 on O_SR   0.00 NA  0.02  0.9877   -0.04    0.644    -0.04       5
 5:  M2-M3 on Y_C   0.06 NA  0.48  0.6486    0.06    0.536     0.06       6
 6: M2-M3 on Y_SR   0.09 NA  0.96  0.3795    0.17    0.004     0.17       6
 7:  M2-M3 on O_C   0.10 NA  0.77  0.4761    0.09    0.248     0.09       5
 8: M2-M3 on O_SR   0.09 NA  1.38  0.2253    0.10    0.096     0.10       5
 9:  M3-M4 on Y_C  -0.13 NA -1.13  0.3095   -0.16    0.044    -0.16       6
10: M3-M4 on Y_SR  -0.03 NA -0.19  0.8535   -0.08    0.592    -0.08       6
11:  M3-M4 on O_C  -0.19 NA -0.99  0.3687   -0.23    0.064    -0.23       5
12: M3-M4 on O_SR  -0.09 NA -0.58  0.5857   -0.09    0.448    -0.12       6
13:  M4-M5 on Y_C  -0.02 NA -0.23  0.8244    0.08    0.548     0.08       6
14: M4-M5 on Y_SR   0.08 NA  0.57  0.5904    0.21    0.020     0.21       6
15:  M4-M5 on O_C  -0.09 NA -1.15  0.3014   -0.04    0.396    -0.04       5
16: M4-M5 on O_SR  -0.02 NA -0.34  0.7458    0.03    0.756     0.02       5
    test.yuen EffSize.yuen pvaluet.yuen
 1:      0.45         0.12       0.6669
 2:      0.31         0.17       0.7683
 3:      2.68         0.47       0.0439
 4:     -0.62         0.18       0.5653
 5:      0.65         0.20       0.5385
 6:      1.73         0.72       0.1345
 7:      1.01         0.44       0.3583
 8:      2.17         0.36       0.0823
 9:     -2.02         0.54       0.0902
10:     -0.74         0.20       0.4885
11:     -1.88         0.66       0.1191
12:     -1.34         0.25       0.2285
13:      0.64         0.23       0.5470
14:      2.69         0.51       0.0359
15:     -0.69         0.18       0.5228
16:      0.49         0.06       0.6463

$DetallSimple
$DetallSimple[[1]]
$DetallSimple[[1]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 0.91 0.352   0.91  0.352  1.10 0.3006 0.3589        0.358       
2:     Sleep 0.14 0.713   0.14  0.713  0.01 0.9305 0.7179        0.724       
3: Age*Sleep 0.09 0.773  -0.02  0.920  0.07 0.7992 0.8831        0.757       
   EffSize
1:    0.23
2:    0.04
3:    0.11

$DetallSimple[[1]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -1.71 11.82 -0.06  0.9535      0.02      0.00 0.9444
2:   Sleep on Old -14.17  9.80 -0.45  0.6607      0.17      0.20 0.6600
3: Age on Control -14.00 10.98 -0.47  0.6471      0.20      0.22 0.6522
4:      Age on SR -26.45 10.06 -0.87  0.4043      0.31      0.76 0.4278
   EffSize.Boot
1:         0.02
2:         0.15
3:         0.21
4:         0.31

$DetallSimple[[1]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -1.71 11.82 -0.06  0.9535      0.02      0.00 0.9400
2:   Sleep on Old -14.17  9.80 -0.45  0.6607      0.16      0.20 0.6878
3: Age on Control -14.00 10.98 -0.47  0.6471      0.21      0.22 0.6867
4:      Age on SR -26.45 10.06 -0.87  0.4043      0.31      0.76 0.4027
5:      YSR vs OC -12.29 10.71 -0.44  0.6694      0.18      0.19 0.6930
   EffSize.Boot
1:         0.02
2:         0.15
3:         0.20
4:         0.31
5:         0.15


$DetallSimple[[2]]
$DetallSimple[[2]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 2.43 0.140   2.43  0.140  2.06 0.1603 0.1636        0.135       
2:     Sleep 0.48 0.498   0.48  0.498  0.52 0.4746 0.5142        0.503       
3: Age*Sleep 0.40 0.535   0.04  0.830  0.13 0.7191     NA        0.533       
   EffSize
1:    0.32
2:    0.16
3:    0.21

$DetallSimple[[2]]$Detall
            Contr psihat   df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young -37.14 8.97 -0.84  0.4218      0.28      0.71 0.4060
2:   Sleep on Old  -1.67 5.60 -0.05  0.9628      0.06      0.00 0.9633
3: Age on Control -61.21 6.52 -1.53  0.1737      0.46      2.33 0.1989
4:      Age on SR -25.74 8.42 -0.66  0.5253      0.21      0.44 0.5100
   EffSize.Boot
1:         0.28
2:         0.11
3:         0.46
4:         0.21

$DetallSimple[[2]]$DetallExt
            Contr psihat   df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young -37.14 8.97 -0.84  0.4218      0.28      0.71 0.3733
2:   Sleep on Old  -1.67 5.60 -0.05  0.9628      0.11      0.00 0.9566
3: Age on Control -61.21 6.52 -1.53  0.1737      0.47      2.33 0.1744
4:      Age on SR -25.74 8.42 -0.66  0.5253      0.21      0.44 0.5044
5:      YSR vs OC -24.07 7.87 -1.11  0.3014      0.37      1.22 0.3215
   EffSize.Boot
1:         0.28
2:         0.08
3:         0.44
4:         0.21
5:         0.38


$DetallSimple[[3]]
$DetallSimple[[3]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 0.09 0.768   0.09  0.768  0.01 0.9407 0.7195        0.761       
2:     Sleep 2.33 0.153   2.33  0.153  2.28 0.1424 0.1436        0.132       
3: Age*Sleep 3.63 0.080  -0.28  0.140  3.41 0.0760     NA        0.090       
   EffSize
1:    0.08
2:    0.34
3:    0.56

$DetallSimple[[3]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  10.57  7.65  0.31  0.7684      0.10      0.09 0.7667
2:   Sleep on Old -96.17  5.34 -2.18  0.0771      0.79      4.77 0.0935
3: Age on Control  61.86  9.66  1.14  0.2804      0.36      1.31 0.2533
4:      Age on SR -44.88 10.08 -3.09  0.0114      0.71      9.52 0.0078
   EffSize.Boot
1:         0.10
2:         0.79
3:         0.34
4:         0.69

$DetallSimple[[3]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  10.57  7.65  0.31  0.7684      0.10      0.09 0.7667
2:   Sleep on Old -96.17  5.34 -2.18  0.0771      0.79      4.77 0.1147
3: Age on Control  61.86  9.66  1.14  0.2804      0.36      1.31 0.2700
4:      Age on SR -44.88 10.08 -3.09  0.0114      0.69      9.52 0.0067
5:      YSR vs OC  51.29  5.79  1.14  0.2989      0.51      1.30 0.3059
   EffSize.Boot
1:         0.10
2:         0.79
3:         0.37
4:         0.71
5:         0.51


$DetallSimple[[4]]
$DetallSimple[[4]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1 pBoot Sig pBootMas SigMas
1:       Age 2.45 0.151   2.45  0.151  1.09 0.3072    NA            1       
2:     Sleep 0.24 0.640   0.24  0.640  0.05 0.8199    NA            0  *    
3: Age*Sleep 0.09 0.775  -0.21  0.330  1.21 0.2838    NA            0  *    
   EffSize
1:    0.40
2:    0.15
3:    0.21

$DetallSimple[[4]]$Detall
            Contr psihat    df test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  19.95 10.12 1.19  0.2600      0.38      1.42 0.2500
2:   Sleep on Old   4.83  6.62 0.10  0.9231      0.03      0.01 0.9185
3: Age on Control  47.50  5.84 1.02  0.3475      0.33      1.04 0.3056
4:      Age on SR  32.38  8.16 1.54  0.1618      0.48      2.37 0.1557
   EffSize.Boot
1:         0.37
2:         0.03
3:         0.31
4:         0.48

$DetallSimple[[4]]$DetallExt
            Contr psihat    df test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  19.95 10.12 1.19  0.2600      0.37      1.42 0.2636
2:   Sleep on Old   4.83  6.62 0.10  0.9231      0.03      0.01 0.9075
3: Age on Control  47.50  5.84 1.02  0.3475      0.33      1.04 0.3467
4:      Age on SR  32.38  8.16 1.54  0.1618      0.48      2.37 0.1846
5:      YSR vs OC  27.55  5.56 0.60  0.5719      0.22      0.36 0.5322
   EffSize.Boot
1:         0.37
2:         0.03
3:         0.32
4:         0.49
5:         0.21


$DetallSimple[[5]]
$DetallSimple[[5]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1 pBoot Sig pBootMas SigMas
1:       Age 2.17 0.157   2.17  0.157  3.92 0.0558    NA            1       
2:     Sleep 0.12 0.731   0.12  0.731  0.03 0.8542    NA            0  *    
3: Age*Sleep 1.04 0.322  -0.18  0.390  2.70 0.1095    NA            0  *    
   EffSize
1:    0.39
2:    0.16
3:    0.33

$DetallSimple[[5]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  41.57 10.91  1.02  0.3308      0.33      1.04 0.3263
2:   Sleep on Old -20.33  8.27 -0.45  0.6628      0.17      0.20 0.6556
3: Age on Control -13.83  9.59 -0.37  0.7181      0.17      0.14 0.7305
4:      Age on SR -75.74  9.68 -1.58  0.1469      0.47      2.49 0.1667
   EffSize.Boot
1:         0.33
2:         0.17
3:         0.17
4:         0.46

$DetallSimple[[5]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  41.57 10.91  1.02  0.3308      0.32      1.04 0.3404
2:   Sleep on Old -20.33  8.27 -0.45  0.6628      0.17      0.20 0.6552
3: Age on Control -13.83  9.59 -0.37  0.7181      0.15      0.14 0.7138
4:      Age on SR -75.74  9.68 -1.58  0.1469      0.47      2.49 0.1633
5:      YSR vs OC -55.40 10.86 -1.49  0.1646      0.50      2.22 0.1635
   EffSize.Boot
1:         0.32
2:         0.17
3:         0.15
4:         0.46
5:         0.53
Omnibus AOV. Design 2x2x(5xS)
Names Q p pBoot Sig pBootMas Sig2
Age 0.37 0.5423 0.5209 0.5387
Sleep 0.00 0.9739 0.9800 0.9714
Time 0.37 0.8322 0.0401
0.0292
Age*Sleep 1.30 0.2549 0.2705 0.0000
Age*Time 0.12 0.9768 0.4057 0.4246
Sleep*Time 0.26 0.9009 0.1035 0.0834
AgeSleepTime 0.08 0.9877 0.5676 0.6005
Interaction Age-Sleep. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1
Sleep on Young 0.28 41.16 1.17 0.2483 0.03
Sleep on Old -0.18 35.53 -0.74 0.4619 0.23
Age on Control 0.13 40.55 0.59 0.5612 0.10
Age on SR -0.34 39.03 -1.27 0.2120 0.22
Interaction Age-Time. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1
Age on M1 0.08 14.20 0.50 0.6221 0.13
Age on M2 0.07 18.86 0.58 0.5683 0.13
Age on M3 0.03 17.48 0.22 0.8249 0.05
Age on M4 -0.05 17.97 -0.30 0.7642 0.08
Age on M5 -0.34 16.23 -1.88 0.0780 0.45
M1-M2 on Young -0.03 NA -0.14 0.8904 0.12
M1-M2 on Old 0.09 NA 2.12 0.0874 0.11
M2-M3 on Young 0.23 NA 2.27 0.0722 0.41
M2-M3 on Old 0.17 NA 1.01 0.3570 0.34
M3-M4 on Young -0.20 NA -1.23 0.2720 0.42
M3-M4 on Old -0.30 NA -1.46 0.2045 0.40
M4-M5 on Young 0.11 NA 0.61 0.5693 0.37
M4-M5 on Old -0.07 NA -0.98 0.3725 0.05
Interaction Sleep-Time. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1
Sleep on M1 -0.06 14.20 -0.35 0.7290 0.21
Sleep on M2 -0.21 18.86 -1.85 0.0798 0.43
Sleep on M3 -0.09 17.48 -0.59 0.5606 0.07
Sleep on M4 0.13 17.97 0.86 0.3997 0.19
Sleep on M5 0.33 16.23 1.80 0.0906 0.50
M1-M2 on Young 0.08 NA 0.58 0.5881 0.26
M1-M2 on Old 0.04 NA 0.24 0.8173 0.05
M2-M3 on Young 0.12 NA 0.66 0.5388 0.21
M2-M3 on Old 0.21 NA 2.01 0.1006 0.59
M3-M4 on Young -0.30 NA -1.07 0.3324 0.57
M3-M4 on Old -0.03 NA -0.39 0.7108 0.27
M4-M5 on Young -0.11 NA -0.88 0.4184 0.00
M4-M5 on Old 0.06 NA 0.27 0.7968 0.39
Main Effect Time. Design 2x2x(5xS)
Contr psihat test p.value Psihat2 p.value2 EfSize.V1
M1-M2 0.09 0.31 0.7657 0.15 0.476 0.12
M2-M3 0.30 2.23 0.0758 0.42 0.052 0.39
M3-M4 -0.39 -1.40 0.2200 -0.56 0.020 0.42
M4-M5 0.13 0.36 0.7305 0.28 0.092 0.21
Simple Effect Time each Age-Sleep condition. Design 2x2x(5xS)
Contr psihat df test p.value Psihat2 p.value2 dif.yuen df.yuen test.yuen EffSize.yuen pvaluet.yuen
M1-M2 on Y_C 0.01 NA 0.11 0.9168 0.04 0.668 0.04 6 0.45 0.12 0.6669
M1-M2 on Y_SR 0.04 NA 0.21 0.8442 0.04 0.736 0.04 6 0.31 0.17 0.7683
M1-M2 on O_C 0.06 NA 1.90 0.1152 0.11 0.004 0.11 5 2.68 0.47 0.0439
M1-M2 on O_SR 0.00 NA 0.02 0.9877 -0.04 0.644 -0.04 5 -0.62 0.18 0.5653
M2-M3 on Y_C 0.06 NA 0.48 0.6486 0.06 0.536 0.06 6 0.65 0.20 0.5385
M2-M3 on Y_SR 0.09 NA 0.96 0.3795 0.17 0.004 0.17 6 1.73 0.72 0.1345
M2-M3 on O_C 0.10 NA 0.77 0.4761 0.09 0.248 0.09 5 1.01 0.44 0.3583
M2-M3 on O_SR 0.09 NA 1.38 0.2253 0.10 0.096 0.10 5 2.17 0.36 0.0823
M3-M4 on Y_C -0.13 NA -1.13 0.3095 -0.16 0.044 -0.16 6 -2.02 0.54 0.0902
M3-M4 on Y_SR -0.03 NA -0.19 0.8535 -0.08 0.592 -0.08 6 -0.74 0.20 0.4885
M3-M4 on O_C -0.19 NA -0.99 0.3687 -0.23 0.064 -0.23 5 -1.88 0.66 0.1191
M3-M4 on O_SR -0.09 NA -0.58 0.5857 -0.09 0.448 -0.12 6 -1.34 0.25 0.2285
M4-M5 on Y_C -0.02 NA -0.23 0.8244 0.08 0.548 0.08 6 0.64 0.23 0.5470
M4-M5 on Y_SR 0.08 NA 0.57 0.5904 0.21 0.020 0.21 6 2.69 0.51 0.0359
M4-M5 on O_C -0.09 NA -1.15 0.3014 -0.04 0.396 -0.04 5 -0.69 0.18 0.5228
M4-M5 on O_SR -0.02 NA -0.34 0.7458 0.03 0.756 0.02 5 0.49 0.06 0.6463
Simple Effect Age-Sleep on Time=1 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.91 0.352 0.91 0.352 1.10 0.3006 0.3589 0.358 0.23
Sleep 0.14 0.713 0.14 0.713 0.01 0.9305 0.7179 0.724 0.04
Age*Sleep 0.09 0.773 -0.02 0.920 0.07 0.7992 0.8831 0.757 0.11
Simple Effect Age-Sleep on Time=1 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -1.71 11.82 -0.06 0.9535 0.02 0.00 0.9444 0.02
Sleep on Old -14.17 9.80 -0.45 0.6607 0.17 0.20 0.6600 0.15
Age on Control -14.00 10.98 -0.47 0.6471 0.20 0.22 0.6522 0.21
Age on SR -26.45 10.06 -0.87 0.4043 0.31 0.76 0.4278 0.31
Simple Effect Age-Sleep on Time=1 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -1.71 11.82 -0.06 0.9535 0.02 0.00 0.9400 0.02
Sleep on Old -14.17 9.80 -0.45 0.6607 0.16 0.20 0.6878 0.15
Age on Control -14.00 10.98 -0.47 0.6471 0.21 0.22 0.6867 0.20
Age on SR -26.45 10.06 -0.87 0.4043 0.31 0.76 0.4027 0.31
YSR vs OC -12.29 10.71 -0.44 0.6694 0.18 0.19 0.6930 0.15
Simple Effect Age-Sleep on Time=2 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 2.43 0.140 2.43 0.140 2.06 0.1603 0.1636 0.135 0.32
Sleep 0.48 0.498 0.48 0.498 0.52 0.4746 0.5142 0.503 0.16
Age*Sleep 0.40 0.535 0.04 0.830 0.13 0.7191 NA 0.533 0.21
Simple Effect Age-Sleep on Time=2 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -37.14 8.97 -0.84 0.4218 0.28 0.71 0.4060 0.28
Sleep on Old -1.67 5.60 -0.05 0.9628 0.06 0.00 0.9633 0.11
Age on Control -61.21 6.52 -1.53 0.1737 0.46 2.33 0.1989 0.46
Age on SR -25.74 8.42 -0.66 0.5253 0.21 0.44 0.5100 0.21
Simple Effect Age-Sleep on Time=2 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -37.14 8.97 -0.84 0.4218 0.28 0.71 0.3733 0.28
Sleep on Old -1.67 5.60 -0.05 0.9628 0.11 0.00 0.9566 0.08
Age on Control -61.21 6.52 -1.53 0.1737 0.47 2.33 0.1744 0.44
Age on SR -25.74 8.42 -0.66 0.5253 0.21 0.44 0.5044 0.21
YSR vs OC -24.07 7.87 -1.11 0.3014 0.37 1.22 0.3215 0.38
Simple Effect Age-Sleep on Time=3 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.09 0.768 0.09 0.768 0.01 0.9407 0.7195 0.761 0.08
Sleep 2.33 0.153 2.33 0.153 2.28 0.1424 0.1436 0.132 0.34
Age*Sleep 3.63 0.080 -0.28 0.140 3.41 0.0760 NA 0.090 0.56
Simple Effect Age-Sleep on Time=3 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 10.57 7.65 0.31 0.7684 0.10 0.09 0.7667 0.10
Sleep on Old -96.17 5.34 -2.18 0.0771 0.79 4.77 0.0935 0.79
Age on Control 61.86 9.66 1.14 0.2804 0.36 1.31 0.2533 0.34
Age on SR -44.88 10.08 -3.09 0.0114 0.71 9.52 0.0078 0.69
Simple Effect Age-Sleep on Time=3 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 10.57 7.65 0.31 0.7684 0.10 0.09 0.7667 0.10
Sleep on Old -96.17 5.34 -2.18 0.0771 0.79 4.77 0.1147 0.79
Age on Control 61.86 9.66 1.14 0.2804 0.36 1.31 0.2700 0.37
Age on SR -44.88 10.08 -3.09 0.0114 0.69 9.52 0.0067 0.71
YSR vs OC 51.29 5.79 1.14 0.2989 0.51 1.30 0.3059 0.51
Simple Effect Age-Sleep on Time=4 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 2.45 0.151 2.45 0.151 1.09 0.3072 NA 1 0.40
Sleep 0.24 0.640 0.24 0.640 0.05 0.8199 NA 0
0.15
Age*Sleep 0.09 0.775 -0.21 0.330 1.21 0.2838 NA 0
0.21
Simple Effect Age-Sleep on Time=4 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 19.95 10.12 1.19 0.2600 0.38 1.42 0.2500 0.37
Sleep on Old 4.83 6.62 0.10 0.9231 0.03 0.01 0.9185 0.03
Age on Control 47.50 5.84 1.02 0.3475 0.33 1.04 0.3056 0.31
Age on SR 32.38 8.16 1.54 0.1618 0.48 2.37 0.1557 0.48
Simple Effect Age-Sleep on Time=4 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 19.95 10.12 1.19 0.2600 0.37 1.42 0.2636 0.37
Sleep on Old 4.83 6.62 0.10 0.9231 0.03 0.01 0.9075 0.03
Age on Control 47.50 5.84 1.02 0.3475 0.33 1.04 0.3467 0.32
Age on SR 32.38 8.16 1.54 0.1618 0.48 2.37 0.1846 0.49
YSR vs OC 27.55 5.56 0.60 0.5719 0.22 0.36 0.5322 0.21
Simple Effect Age-Sleep on Time=5 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 2.17 0.157 2.17 0.157 3.92 0.0558 NA 1 0.39
Sleep 0.12 0.731 0.12 0.731 0.03 0.8542 NA 0
0.16
Age*Sleep 1.04 0.322 -0.18 0.390 2.70 0.1095 NA 0
0.33
Simple Effect Age-Sleep on Time=5 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 41.57 10.91 1.02 0.3308 0.33 1.04 0.3263 0.33
Sleep on Old -20.33 8.27 -0.45 0.6628 0.17 0.20 0.6556 0.17
Age on Control -13.83 9.59 -0.37 0.7181 0.17 0.14 0.7305 0.17
Age on SR -75.74 9.68 -1.58 0.1469 0.47 2.49 0.1667 0.46
Simple Effect Age-Sleep on Time=5 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 41.57 10.91 1.02 0.3308 0.32 1.04 0.3404 0.32
Sleep on Old -20.33 8.27 -0.45 0.6628 0.17 0.20 0.6552 0.17
Age on Control -13.83 9.59 -0.37 0.7181 0.15 0.14 0.7138 0.15
Age on SR -75.74 9.68 -1.58 0.1469 0.47 2.49 0.1633 0.46
YSR vs OC -55.40 10.86 -1.49 0.1646 0.50 2.22 0.1635 0.53

8.6 Fig 7G Frequency during recovery {Design 2x2x((5+1)xS)

  NmBas="Fig7G SpindFreq Recover"
  NmFich<-paste0(PathDesign,"DeltaTetaSpindleRecover.csv");
  NmFAlL<-paste0(PathDesign,NmBas)
  if (!dir.exists(NmFAlL)) {dir.create(NmFAlL)}
  NmFAlL<-paste0(NmFAlL,"/")
  ResGen<-NA;ResGen1<-NA;
  
  # Graphs Previously
  rrt<-ExDataIS.2(nmF = NmFich,Vars = ,c(4,5,7,21:26),vIntP =c(4:9),lvlCh = list("Hr 1"="Avg_SpindleHz_NREM_1", "Hr 2"="Avg_SpindleHz_NREM_2","Hr 3"="Avg_SpindleHz_NREM_3","Hr 4"="Avg_SpindleHz_NREM_4","Hr 5"="Avg_SpindleHz_NREM_5","Total"="Avg_SpindleHz_NREM_TT"))
  DatDT<-rrt$DT
  ArP<-rrt$Arp
  ExtendDT<-rrt$ExtendDT
  
  Grp<- Grph.3(DatP = ExtendDT,"OPR",LblsP =c("Spindle Characteristics", "","Spindle Frequency (Hz)"),ylmP =c(10,12),hLin = F,lvIp = 6)
  
  levBp<-seq(0.7, 25, by=0.2)
  Grp2<- Grp + geom_signif(annotation="*",
              y_position=11.5, xmin=levBp[2+25]  , xmax=levBp[4+25], 
              tip_length = c(0.02, 0.02),vjust=0.5,textsize=10)
  
  #AOV 1 Global
  rrt<-ExData.2(nmF = NmFich,Vars = c(4,5,26))
  DatDT<-rrt$DT
  ArP<-rrt$Arp
  
  names(rrt$DT)[3]<-"DepV"
  ResGen1<-AOVBwF(2,2,DatPas = rrt,nBMM = 10000)
  AlmacenGen(Grp,Grp2,ResGen1,PathDesign,paste0(NmBas,"_Total"),Typ=1)
  
  #AOV 2 For Time Details
  rrt2<-ExDataIS.2(nmF = NmFich,Vars = c(4,5,7,21:25),vIntP =c(4:8),lvlCh = list("Hr 1"="Avg_SpindleHz_NREM_1", "Hr 2"="Avg_SpindleHz_NREM_2","Hr 3"="Avg_SpindleHz_NREM_3","Hr 4"="Avg_SpindleHz_NREM_4","Hr 5"="Avg_SpindleHz_NREM_5"))
  DatDT<-rrt2$DT
  ArP<-rrt2$Arp
  ExtendDT<-rrt2$ExtendDT
  
  # Simple Effects:
  DatEfS<-list()
  for(is in 1:5) {
    DatEfS[[is]]<-ExData.2(nmF = NmFich,Vars = c(4:5,(8+is)))
    names(DatEfS[[is]]$DT)[3]<-"DepV"
  }
  
  names(rrt2$DT)[4:8]<-c("T1","T2","T3","T4","T5")
  ResGen<-AOVMx2.5(A=2,B=2,C=5,DatPas = rrt2,DatEfSp = DatEfS,nBMM1 = 10000,nBMM2 = 1000,Prc = 2)
  AlmacenGen2(GrpP = Grp,Grp2P = Grp2,DataPas = ResGen,PathDesignP = PathDesign,NmBasP = paste0(NmBas,"_TimeDetail"),Typ=2)
  
  # Other Graphs for Time details
    ExtendDT2<-rrt2$ExtendDT
    ExtendDTCol<-copy(ExtendDT2)
    ExtendDTCol$Moment<-"All"
    ExtendDTCol<-data.table(rbind(ExtendDT2,ExtendDTCol))
    
    Grp3<- Grph.3(DatP = ExtendDTCol,"OPR",LblsP =c("Spindle Characteristics", "","Spindle Frequency (Hz)"),ylmP =c(10,12),hLin = F,lvIp = 6,wMain = T)
    
    GrpO<-Grph.3.Otros(ExtendDT,LblsP =c("Spindle Characteristics", "","Spindle Frequency (Hz)"))
   
    pdf(paste0(NmFAlL,NmBas,"OtrosGraphs.pdf"))
      Grp3
      GrpO
    dev.off()
    
    #Results
    #AOV 1 Global
    ResGen1
    Kbl3(ResGen1[[1]], "Omnibus AOV. Design 2x2")
    Kbl3(ResGen1[[2]], "Simple Effects Age-Sleep. Design 2x2")
    Kbl3(ResGen1[[3]], "Extense Simple Effects Age-Sleep. Design 2x2")
    
    #AOV 2 For Time Details
        # Results
        plot(Grp)
        plot(Grp2) # Only this graph is printed in the html file.
        GrpO
        plot(Grp3)
        ResGen # Lean option to view the results of statistical analysis
        
        Kbl3(ResPas = ResGen[[1]], lbl = "Omnibus AOV. Design 2x2x(5xS)");cat("\n")
        Kbl3(ResGen[[2]], "Interaction Age-Sleep. Design 2x2x(5xS)")
        Kbl3(ResGen[[3]], "Interaction Age-Time. Design 2x2x(5xS)")
        Kbl3(ResGen[[4]], "Interaction Sleep-Time. Design 2x2x(5xS)")
        Kbl3(ResGen[[5]], "Main Effect Time. Design 2x2x(5xS)")
        Kbl3(ResGen[[6]], "Simple Effect Time each Age-Sleep condition. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[1]][[1]], "Simple Effect Age-Sleep on Time=1 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[1]][[2]], "Simple Effect Age-Sleep on Time=1 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[1]][[3]], "Simple Effect Age-Sleep on Time=1 Extense Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[2]][[1]], "Simple Effect Age-Sleep on Time=2 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[2]][[2]], "Simple Effect Age-Sleep on Time=2 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[2]][[3]], "Simple Effect Age-Sleep on Time=2 Extense Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[3]][[1]], "Simple Effect Age-Sleep on Time=3 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[3]][[2]], "Simple Effect Age-Sleep on Time=3 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[3]][[3]], "Simple Effect Age-Sleep on Time=3 Extense Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[4]][[1]], "Simple Effect Age-Sleep on Time=4 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[4]][[2]], "Simple Effect Age-Sleep on Time=4 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[4]][[3]], "Simple Effect Age-Sleep on Time=4 Extense Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[5]][[1]], "Simple Effect Age-Sleep on Time=5 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[5]][[2]], "Simple Effect Age-Sleep on Time=5 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[5]][[3]], "Simple Effect Age-Sleep on Time=5 Extense Simple Effects. Design 2x2x(5xS)")
[1] "Taking bootstrap samples. Please wait."
          Eff   p.V1 p.Sig
1:  A.p.value 0.0100 *    
2:  B.p.value 0.9967      
3: AB.p.value 0.0985      
[1] "Taking bootstrap samples. Please wait."
          Eff   p.V1 p.Sig
1:  A.p.value 0.0030 *    
2:  B.p.value 0.9982      
3: AB.p.value 0.0565      
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
           Eff   p.V1 p.Sig
1:   p.value.A 0.0033 *    
2:   p.value.B 0.9649      
3:   p.value.C 0.2538      
4:  p.value.AB 0.0818      
5:  p.value.AC 0.9549      
6:  p.value.BC 0.1386      
7: p.value.ABC 0.5793      
           Eff   p.V1 p.Sig
1:   p.value.A 0.0058 *    
2:   p.value.B 0.9547      
3:   p.value.C 0.2434      
4:  p.value.AB 0.0000 *    
5:  p.value.AC 0.9480      
6:  p.value.BC 0.1084      
7: p.value.ABC 0.6128      
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
$BP

$Bars

$MargAB

$MargAC

$MargBC

$MargC

quartz_off_screen 
                2 
$AOV
       Names     Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot   Sig pBootMas
1:       Age 10.32 0.004  10.32  0.004  5.53 0.0248 0.0100 *       0.0030
2:     Sleep  0.00 0.998   0.00  0.998  0.00 0.9811 0.9967         0.9982
3: Age*Sleep  3.86 0.062   0.37  0.050  3.00 0.0926 0.0985         0.0565
   SigMas EffSize
1:  *        0.56
2:           0.03
3:           0.54

$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.09 11.92 -1.27  0.2296      0.36      1.60 0.2489
2:   Sleep on Old   0.09  9.56  1.56  0.1519      0.42      2.42 0.1489
3: Age on Control   0.06 11.00  0.87  0.4049      0.24      0.75 0.4022
4:      Age on SR   0.24 10.29  3.73  0.0037      0.83     13.92 0.0022
   EffSize.Boot
1:         0.36
2:         0.40
3:         0.28
4:         0.85

$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.09 11.92 -1.27  0.2296      0.36      1.60 0.2156
2:   Sleep on Old   0.09  9.56  1.56  0.1519      0.46      2.42 0.1157
3: Age on Control   0.06 11.00  0.87  0.4049      0.25      0.75 0.4344
4:      Age on SR   0.24 10.29  3.73  0.0037      0.83     13.92 0.0022
5:      YSR vs OC   0.15 10.96  2.13  0.0562      0.63      4.56 0.0367
   EffSize.Boot
1:         0.36
2:         0.41
3:         0.25
4:         0.83
5:         0.64
Omnibus AOV. Design 2x2
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 10.32 0.004 10.32 0.004 5.53 0.0248 0.0100
0.0030
0.56
Sleep 0.00 0.998 0.00 0.998 0.00 0.9811 0.9967 0.9982 0.03
Age*Sleep 3.86 0.062 0.37 0.050 3.00 0.0926 0.0985 0.0565 0.54
Simple Effects Age-Sleep. Design 2x2
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.09 11.92 -1.27 0.2296 0.36 1.60 0.2489 0.36
Sleep on Old 0.09 9.56 1.56 0.1519 0.42 2.42 0.1489 0.40
Age on Control 0.06 11.00 0.87 0.4049 0.24 0.75 0.4022 0.28
Age on SR 0.24 10.29 3.73 0.0037 0.83 13.92 0.0022 0.85
Extense Simple Effects Age-Sleep. Design 2x2
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.09 11.92 -1.27 0.2296 0.36 1.60 0.2156 0.36
Sleep on Old 0.09 9.56 1.56 0.1519 0.46 2.42 0.1157 0.41
Age on Control 0.06 11.00 0.87 0.4049 0.25 0.75 0.4344 0.25
Age on SR 0.24 10.29 3.73 0.0037 0.83 13.92 0.0022 0.83
YSR vs OC 0.15 10.96 2.13 0.0562 0.63 4.56 0.0367 0.64
$BP

$Bars

$MargAB

$MargAC

$MargBC

$MargC

$AOV
            Names    Q      p  pBoot   Sig pBootMas  Sig2
1:            Age 7.94 0.0049 0.0033 *       0.0058 *    
2:          Sleep 0.00 0.9561 0.9649         0.9547      
3:           Time 0.17 0.9555 0.2538         0.2434      
4:      Age*Sleep 2.91 0.0884 0.0818         0.0000 *    
5:       Age*Time 0.02 0.9991 0.9549         0.9480      
6:     Sleep*Time 0.24 0.9159 0.1386         0.1084      
7: Age*Sleep*Time 0.08 0.9887 0.5793         0.6128      

$InterAB
            Contr psihat    df  test p.value EfSize.V1
1: Sleep on Young  -0.46 53.18 -2.15  0.0362      0.36
2:   Sleep on Old   0.45 33.11  1.74  0.0908      0.42
3: Age on Control   0.31 38.11  1.12  0.2693      0.31
4:      Age on SR   1.22 53.10  6.32  0.0000      0.83

$InterAC
             Contr psihat    df  test p.value EfSize.V1
 1:      Age on M1   0.27 19.92  2.60  0.0170      0.51
 2:      Age on M2   0.28 17.99  1.94  0.0688      0.47
 3:      Age on M3   0.27 16.41  1.62  0.1245      0.47
 4:      Age on M4   0.39 13.63  2.30  0.0378      0.49
 5:      Age on M5   0.31 15.97  2.00  0.0628      0.37
 6: M1-M2 on Young   0.08    NA  0.60  0.5745      0.12
 7:   M1-M2 on Old   0.05    NA  0.82  0.4485      0.13
 8: M2-M3 on Young  -0.17    NA -1.35  0.2354      0.16
 9:   M2-M3 on Old  -0.06    NA -0.64  0.5523      0.15
10: M3-M4 on Young   0.04    NA  0.56  0.6023      0.03
11:   M3-M4 on Old   0.11    NA  0.62  0.5634      0.08
12: M4-M5 on Young  -0.10    NA -0.82  0.4515      0.10
13:   M4-M5 on Old  -0.07    NA -0.34  0.7476      0.12

$InterBC
             Contr psihat    df  test p.value EfSize.V1
 1:    Sleep on M1   0.01 19.92  0.11  0.9147      0.04
 2:    Sleep on M2   0.00 17.99  0.01  0.9940      0.04
 3:    Sleep on M3   0.01 16.41  0.03  0.9742      0.03
 4:    Sleep on M4  -0.28 13.63 -1.62  0.1282      0.41
 5:    Sleep on M5   0.25 15.97  1.64  0.1201      0.27
 6: M1-M2 on Young   0.05    NA  0.39  0.7116      0.17
 7:   M1-M2 on Old   0.05    NA  0.63  0.5558      0.16
 8: M2-M3 on Young  -0.16    NA -0.67  0.5350      0.16
 9:   M2-M3 on Old  -0.17    NA -1.44  0.2103      0.23
10: M3-M4 on Young   0.26    NA  1.06  0.3377      0.22
11:   M3-M4 on Old  -0.07    NA -0.97  0.3764      0.17
12: M4-M5 on Young  -0.42    NA -1.64  0.1612      0.49
13:   M4-M5 on Old   0.23    NA  1.24  0.2713      0.21

$DetallMainC
   Contr psihat  test p.value Psihat2 p.value2 EfSize.V1
1: M1-M2   0.12  1.14  0.3041    0.13    0.104      0.15
2: M2-M3  -0.27 -1.28  0.2560   -0.21    0.244      0.18
3: M3-M4   0.19  1.02  0.3543    0.08    0.452      0.03
4: M4-M5  -0.19 -1.04  0.3478   -0.22    0.368      0.12

$DetallTrialCadaCondAB
            Contr psihat df  test p.value Psihat2 p.value2 dif.yuen df.yuen
 1:  M1-M2 on Y_C   0.01 NA  0.09  0.9281    0.04    0.728     0.04       6
 2: M1-M2 on Y_SR   0.04 NA  0.79  0.4633    0.03    0.484     0.03       6
 3:  M1-M2 on O_C   0.04 NA  0.82  0.4502    0.03    0.564     0.03       5
 4: M1-M2 on O_SR  -0.01 NA -0.25  0.8119    0.03    0.500     0.03       5
 5:  M2-M3 on Y_C  -0.05 NA -0.40  0.7076   -0.06    0.572    -0.06       6
 6: M2-M3 on Y_SR  -0.09 NA -1.05  0.3404   -0.04    0.240    -0.04       6
 7:  M2-M3 on O_C  -0.03 NA -0.59  0.5824   -0.04    0.728    -0.04       5
 8: M2-M3 on O_SR  -0.05 NA -0.64  0.5533   -0.07    0.272    -0.07       5
 9:  M3-M4 on Y_C   0.10 NA  1.96  0.1074    0.07    0.316     0.07       6
10: M3-M4 on Y_SR  -0.07 NA -1.60  0.1706   -0.09    0.024    -0.09       6
11:  M3-M4 on O_C   0.12 NA  0.57  0.5932    0.11    0.344     0.11       5
12: M3-M4 on O_SR  -0.01 NA -0.15  0.8852   -0.01    0.772    -0.01       6
13:  M4-M5 on Y_C  -0.13 NA -1.25  0.2661   -0.11    0.004    -0.11       6
14: M4-M5 on Y_SR   0.06 NA  0.74  0.4950    0.05    0.476     0.05       6
15:  M4-M5 on O_C  -0.20 NA -1.29  0.2526   -0.26    0.080    -0.26       5
16: M4-M5 on O_SR   0.13 NA  1.07  0.3341    0.11    0.192     0.10       5
    test.yuen EffSize.yuen pvaluet.yuen
 1:      0.42         0.18       0.6895
 2:      0.61         0.08       0.5627
 3:      0.54         0.11       0.6114
 4:      0.72         0.16       0.5018
 5:     -0.57         0.19       0.5906
 6:     -1.08         0.13       0.3202
 7:     -0.39         0.12       0.7117
 8:     -1.01         0.29       0.3609
 9:      0.88         0.21       0.4131
10:     -2.09         0.28       0.0812
11:      1.01         0.22       0.3598
12:     -0.22         0.05       0.8349
13:     -2.12         0.41       0.0782
14:      0.70         0.14       0.5078
15:     -1.68         0.53       0.1548
16:      1.32         0.41       0.2433

$DetallSimple
$DetallSimple[[1]]
$DetallSimple[[1]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 0.91 0.352   0.91  0.352  1.10 0.3006 0.3589        0.405       
2:     Sleep 0.14 0.713   0.14  0.713  0.01 0.9305 0.7179        0.708       
3: Age*Sleep 0.09 0.773  -0.02  0.920  0.07 0.7992 0.8831        0.802       
   EffSize
1:    0.23
2:    0.04
3:    0.11

$DetallSimple[[1]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -1.71 11.82 -0.06  0.9535      0.02      0.00 0.9544
2:   Sleep on Old -14.17  9.80 -0.45  0.6607      0.17      0.20 0.6300
3: Age on Control -14.00 10.98 -0.47  0.6471      0.24      0.22 0.6318
4:      Age on SR -26.45 10.06 -0.87  0.4043      0.28      0.76 0.3722
   EffSize.Boot
1:         0.02
2:         0.15
3:         0.20
4:         0.31

$DetallSimple[[1]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -1.71 11.82 -0.06  0.9535      0.02      0.00 0.9533
2:   Sleep on Old -14.17  9.80 -0.45  0.6607      0.15      0.20 0.6622
3: Age on Control -14.00 10.98 -0.47  0.6471      0.18      0.22 0.6533
4:      Age on SR -26.45 10.06 -0.87  0.4043      0.31      0.76 0.4278
5:      YSR vs OC -12.29 10.71 -0.44  0.6694      0.18      0.19 0.6930
   EffSize.Boot
1:         0.02
2:         0.16
3:         0.21
4:         0.26
5:         0.15


$DetallSimple[[2]]
$DetallSimple[[2]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 2.43 0.140   2.43  0.140  2.06 0.1603 0.1636        0.145       
2:     Sleep 0.48 0.498   0.48  0.498  0.52 0.4746 0.5142        0.446       
3: Age*Sleep 0.40 0.535   0.04  0.830  0.13 0.7191     NA        0.505       
   EffSize
1:    0.32
2:    0.16
3:    0.21

$DetallSimple[[2]]$Detall
            Contr psihat   df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young -37.14 8.97 -0.84  0.4218      0.28      0.71 0.4222
2:   Sleep on Old  -1.67 5.60 -0.05  0.9628      0.11      0.00 0.9567
3: Age on Control -61.21 6.52 -1.53  0.1737      0.46      2.33 0.1689
4:      Age on SR -25.74 8.42 -0.66  0.5253      0.21      0.44 0.4911
   EffSize.Boot
1:         0.28
2:         0.12
3:         0.39
4:         0.21

$DetallSimple[[2]]$DetallExt
            Contr psihat   df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young -37.14 8.97 -0.84  0.4218      0.28      0.71 0.3989
2:   Sleep on Old  -1.67 5.60 -0.05  0.9628      0.09      0.00 0.9667
3: Age on Control -61.21 6.52 -1.53  0.1737      0.45      2.33 0.1700
4:      Age on SR -25.74 8.42 -0.66  0.5253      0.21      0.44 0.5222
5:      YSR vs OC -24.07 7.87 -1.11  0.3014      0.37      1.22 0.3215
   EffSize.Boot
1:         0.28
2:         0.09
3:         0.46
4:         0.21
5:         0.38


$DetallSimple[[3]]
$DetallSimple[[3]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 0.09 0.768   0.09  0.768  0.01 0.9407 0.7195        0.759       
2:     Sleep 2.33 0.153   2.33  0.153  2.28 0.1424 0.1436        0.140       
3: Age*Sleep 3.63 0.080  -0.28  0.140  3.41 0.0760     NA        0.090       
   EffSize
1:    0.08
2:    0.34
3:    0.56

$DetallSimple[[3]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  10.57  7.65  0.31  0.7684      0.10      0.09 0.7722
2:   Sleep on Old -96.17  5.34 -2.18  0.0771      0.78      4.77 0.1114
3: Age on Control  61.86  9.66  1.14  0.2804      0.40      1.31 0.2667
4:      Age on SR -44.88 10.08 -3.09  0.0114      0.71      9.52 0.0045
   EffSize.Boot
1:         0.10
2:         0.79
3:         0.34
4:         0.71

$DetallSimple[[3]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  10.57  7.65  0.31  0.7684      0.10      0.09 0.7556
2:   Sleep on Old -96.17  5.34 -2.18  0.0771      0.79      4.77 0.0834
3: Age on Control  61.86  9.66  1.14  0.2804      0.35      1.31 0.2578
4:      Age on SR -44.88 10.08 -3.09  0.0114      0.71      9.52 0.0033
5:      YSR vs OC  51.29  5.79  1.14  0.2989      0.51      1.30 0.3059
   EffSize.Boot
1:         0.10
2:         0.79
3:         0.39
4:         0.71
5:         0.51


$DetallSimple[[4]]
$DetallSimple[[4]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1 pBoot Sig pBootMas SigMas
1:       Age 2.45 0.151   2.45  0.151  1.09 0.3072    NA            1       
2:     Sleep 0.24 0.640   0.24  0.640  0.05 0.8199    NA            0  *    
3: Age*Sleep 0.09 0.775  -0.21  0.330  1.21 0.2838    NA            0  *    
   EffSize
1:    0.40
2:    0.15
3:    0.21

$DetallSimple[[4]]$Detall
            Contr psihat    df test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  19.95 10.12 1.19  0.2600      0.37      1.42 0.2633
2:   Sleep on Old   4.83  6.62 0.10  0.9231      0.03      0.01 0.9143
3: Age on Control  47.50  5.84 1.02  0.3475      0.31      1.04 0.3256
4:      Age on SR  32.38  8.16 1.54  0.1618      0.48      2.37 0.1405
   EffSize.Boot
1:         0.37
2:         0.03
3:         0.31
4:         0.48

$DetallSimple[[4]]$DetallExt
            Contr psihat    df test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  19.95 10.12 1.19  0.2600      0.34      1.42 0.2844
2:   Sleep on Old   4.83  6.62 0.10  0.9231      0.03      0.01 0.9198
3: Age on Control  47.50  5.84 1.02  0.3475      0.31      1.04 0.3378
4:      Age on SR  32.38  8.16 1.54  0.1618      0.48      2.37 0.1435
5:      YSR vs OC  27.55  5.56 0.60  0.5719      0.22      0.36 0.5322
   EffSize.Boot
1:         0.31
2:         0.03
3:         0.33
4:         0.50
5:         0.21


$DetallSimple[[5]]
$DetallSimple[[5]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1 pBoot Sig pBootMas SigMas
1:       Age 2.17 0.157   2.17  0.157  3.92 0.0558    NA            1       
2:     Sleep 0.12 0.731   0.12  0.731  0.03 0.8542    NA            0  *    
3: Age*Sleep 1.04 0.322  -0.18  0.390  2.70 0.1095    NA            0  *    
   EffSize
1:    0.39
2:    0.16
3:    0.33

$DetallSimple[[5]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  41.57 10.91  1.02  0.3308      0.32      1.04 0.3211
2:   Sleep on Old -20.33  8.27 -0.45  0.6628      0.17      0.20 0.6507
3: Age on Control -13.83  9.59 -0.37  0.7181      0.19      0.14 0.7219
4:      Age on SR -75.74  9.68 -1.58  0.1469      0.46      2.49 0.1491
   EffSize.Boot
1:         0.32
2:         0.17
3:         0.18
4:         0.48

$DetallSimple[[5]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  41.57 10.91  1.02  0.3308      0.32      1.04 0.3267
2:   Sleep on Old -20.33  8.27 -0.45  0.6628      0.17      0.20 0.6429
3: Age on Control -13.83  9.59 -0.37  0.7181      0.15      0.14 0.7111
4:      Age on SR -75.74  9.68 -1.58  0.1469      0.46      2.49 0.1811
5:      YSR vs OC -55.40 10.86 -1.49  0.1646      0.50      2.22 0.1635
   EffSize.Boot
1:         0.32
2:         0.17
3:         0.18
4:         0.47
5:         0.53
Omnibus AOV. Design 2x2x(5xS)
Names Q p pBoot Sig pBootMas Sig2
Age 7.94 0.0049 0.0033
0.0058
Sleep 0.00 0.9561 0.9649 0.9547
Time 0.17 0.9555 0.2538 0.2434
Age*Sleep 2.91 0.0884 0.0818 0.0000
Age*Time 0.02 0.9991 0.9549 0.9480
Sleep*Time 0.24 0.9159 0.1386 0.1084
AgeSleepTime 0.08 0.9887 0.5793 0.6128
Interaction Age-Sleep. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1
Sleep on Young -0.46 53.18 -2.15 0.0362 0.36
Sleep on Old 0.45 33.11 1.74 0.0908 0.42
Age on Control 0.31 38.11 1.12 0.2693 0.31
Age on SR 1.22 53.10 6.32 0.0000 0.83
Interaction Age-Time. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1
Age on M1 0.27 19.92 2.60 0.0170 0.51
Age on M2 0.28 17.99 1.94 0.0688 0.47
Age on M3 0.27 16.41 1.62 0.1245 0.47
Age on M4 0.39 13.63 2.30 0.0378 0.49
Age on M5 0.31 15.97 2.00 0.0628 0.37
M1-M2 on Young 0.08 NA 0.60 0.5745 0.12
M1-M2 on Old 0.05 NA 0.82 0.4485 0.13
M2-M3 on Young -0.17 NA -1.35 0.2354 0.16
M2-M3 on Old -0.06 NA -0.64 0.5523 0.15
M3-M4 on Young 0.04 NA 0.56 0.6023 0.03
M3-M4 on Old 0.11 NA 0.62 0.5634 0.08
M4-M5 on Young -0.10 NA -0.82 0.4515 0.10
M4-M5 on Old -0.07 NA -0.34 0.7476 0.12
Interaction Sleep-Time. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1
Sleep on M1 0.01 19.92 0.11 0.9147 0.04
Sleep on M2 0.00 17.99 0.01 0.9940 0.04
Sleep on M3 0.01 16.41 0.03 0.9742 0.03
Sleep on M4 -0.28 13.63 -1.62 0.1282 0.41
Sleep on M5 0.25 15.97 1.64 0.1201 0.27
M1-M2 on Young 0.05 NA 0.39 0.7116 0.17
M1-M2 on Old 0.05 NA 0.63 0.5558 0.16
M2-M3 on Young -0.16 NA -0.67 0.5350 0.16
M2-M3 on Old -0.17 NA -1.44 0.2103 0.23
M3-M4 on Young 0.26 NA 1.06 0.3377 0.22
M3-M4 on Old -0.07 NA -0.97 0.3764 0.17
M4-M5 on Young -0.42 NA -1.64 0.1612 0.49
M4-M5 on Old 0.23 NA 1.24 0.2713 0.21
Main Effect Time. Design 2x2x(5xS)
Contr psihat test p.value Psihat2 p.value2 EfSize.V1
M1-M2 0.12 1.14 0.3041 0.13 0.104 0.15
M2-M3 -0.27 -1.28 0.2560 -0.21 0.244 0.18
M3-M4 0.19 1.02 0.3543 0.08 0.452 0.03
M4-M5 -0.19 -1.04 0.3478 -0.22 0.368 0.12
Simple Effect Time each Age-Sleep condition. Design 2x2x(5xS)
Contr psihat df test p.value Psihat2 p.value2 dif.yuen df.yuen test.yuen EffSize.yuen pvaluet.yuen
M1-M2 on Y_C 0.01 NA 0.09 0.9281 0.04 0.728 0.04 6 0.42 0.18 0.6895
M1-M2 on Y_SR 0.04 NA 0.79 0.4633 0.03 0.484 0.03 6 0.61 0.08 0.5627
M1-M2 on O_C 0.04 NA 0.82 0.4502 0.03 0.564 0.03 5 0.54 0.11 0.6114
M1-M2 on O_SR -0.01 NA -0.25 0.8119 0.03 0.500 0.03 5 0.72 0.16 0.5018
M2-M3 on Y_C -0.05 NA -0.40 0.7076 -0.06 0.572 -0.06 6 -0.57 0.19 0.5906
M2-M3 on Y_SR -0.09 NA -1.05 0.3404 -0.04 0.240 -0.04 6 -1.08 0.13 0.3202
M2-M3 on O_C -0.03 NA -0.59 0.5824 -0.04 0.728 -0.04 5 -0.39 0.12 0.7117
M2-M3 on O_SR -0.05 NA -0.64 0.5533 -0.07 0.272 -0.07 5 -1.01 0.29 0.3609
M3-M4 on Y_C 0.10 NA 1.96 0.1074 0.07 0.316 0.07 6 0.88 0.21 0.4131
M3-M4 on Y_SR -0.07 NA -1.60 0.1706 -0.09 0.024 -0.09 6 -2.09 0.28 0.0812
M3-M4 on O_C 0.12 NA 0.57 0.5932 0.11 0.344 0.11 5 1.01 0.22 0.3598
M3-M4 on O_SR -0.01 NA -0.15 0.8852 -0.01 0.772 -0.01 6 -0.22 0.05 0.8349
M4-M5 on Y_C -0.13 NA -1.25 0.2661 -0.11 0.004 -0.11 6 -2.12 0.41 0.0782
M4-M5 on Y_SR 0.06 NA 0.74 0.4950 0.05 0.476 0.05 6 0.70 0.14 0.5078
M4-M5 on O_C -0.20 NA -1.29 0.2526 -0.26 0.080 -0.26 5 -1.68 0.53 0.1548
M4-M5 on O_SR 0.13 NA 1.07 0.3341 0.11 0.192 0.10 5 1.32 0.41 0.2433
Simple Effect Age-Sleep on Time=1 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.91 0.352 0.91 0.352 1.10 0.3006 0.3589 0.405 0.23
Sleep 0.14 0.713 0.14 0.713 0.01 0.9305 0.7179 0.708 0.04
Age*Sleep 0.09 0.773 -0.02 0.920 0.07 0.7992 0.8831 0.802 0.11
Simple Effect Age-Sleep on Time=1 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -1.71 11.82 -0.06 0.9535 0.02 0.00 0.9544 0.02
Sleep on Old -14.17 9.80 -0.45 0.6607 0.17 0.20 0.6300 0.15
Age on Control -14.00 10.98 -0.47 0.6471 0.24 0.22 0.6318 0.20
Age on SR -26.45 10.06 -0.87 0.4043 0.28 0.76 0.3722 0.31
Simple Effect Age-Sleep on Time=1 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -1.71 11.82 -0.06 0.9535 0.02 0.00 0.9533 0.02
Sleep on Old -14.17 9.80 -0.45 0.6607 0.15 0.20 0.6622 0.16
Age on Control -14.00 10.98 -0.47 0.6471 0.18 0.22 0.6533 0.21
Age on SR -26.45 10.06 -0.87 0.4043 0.31 0.76 0.4278 0.26
YSR vs OC -12.29 10.71 -0.44 0.6694 0.18 0.19 0.6930 0.15
Simple Effect Age-Sleep on Time=2 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 2.43 0.140 2.43 0.140 2.06 0.1603 0.1636 0.145 0.32
Sleep 0.48 0.498 0.48 0.498 0.52 0.4746 0.5142 0.446 0.16
Age*Sleep 0.40 0.535 0.04 0.830 0.13 0.7191 NA 0.505 0.21
Simple Effect Age-Sleep on Time=2 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -37.14 8.97 -0.84 0.4218 0.28 0.71 0.4222 0.28
Sleep on Old -1.67 5.60 -0.05 0.9628 0.11 0.00 0.9567 0.12
Age on Control -61.21 6.52 -1.53 0.1737 0.46 2.33 0.1689 0.39
Age on SR -25.74 8.42 -0.66 0.5253 0.21 0.44 0.4911 0.21
Simple Effect Age-Sleep on Time=2 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -37.14 8.97 -0.84 0.4218 0.28 0.71 0.3989 0.28
Sleep on Old -1.67 5.60 -0.05 0.9628 0.09 0.00 0.9667 0.09
Age on Control -61.21 6.52 -1.53 0.1737 0.45 2.33 0.1700 0.46
Age on SR -25.74 8.42 -0.66 0.5253 0.21 0.44 0.5222 0.21
YSR vs OC -24.07 7.87 -1.11 0.3014 0.37 1.22 0.3215 0.38
Simple Effect Age-Sleep on Time=3 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.09 0.768 0.09 0.768 0.01 0.9407 0.7195 0.759 0.08
Sleep 2.33 0.153 2.33 0.153 2.28 0.1424 0.1436 0.140 0.34
Age*Sleep 3.63 0.080 -0.28 0.140 3.41 0.0760 NA 0.090 0.56
Simple Effect Age-Sleep on Time=3 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 10.57 7.65 0.31 0.7684 0.10 0.09 0.7722 0.10
Sleep on Old -96.17 5.34 -2.18 0.0771 0.78 4.77 0.1114 0.79
Age on Control 61.86 9.66 1.14 0.2804 0.40 1.31 0.2667 0.34
Age on SR -44.88 10.08 -3.09 0.0114 0.71 9.52 0.0045 0.71
Simple Effect Age-Sleep on Time=3 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 10.57 7.65 0.31 0.7684 0.10 0.09 0.7556 0.10
Sleep on Old -96.17 5.34 -2.18 0.0771 0.79 4.77 0.0834 0.79
Age on Control 61.86 9.66 1.14 0.2804 0.35 1.31 0.2578 0.39
Age on SR -44.88 10.08 -3.09 0.0114 0.71 9.52 0.0033 0.71
YSR vs OC 51.29 5.79 1.14 0.2989 0.51 1.30 0.3059 0.51
Simple Effect Age-Sleep on Time=4 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 2.45 0.151 2.45 0.151 1.09 0.3072 NA 1 0.40
Sleep 0.24 0.640 0.24 0.640 0.05 0.8199 NA 0
0.15
Age*Sleep 0.09 0.775 -0.21 0.330 1.21 0.2838 NA 0
0.21
Simple Effect Age-Sleep on Time=4 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 19.95 10.12 1.19 0.2600 0.37 1.42 0.2633 0.37
Sleep on Old 4.83 6.62 0.10 0.9231 0.03 0.01 0.9143 0.03
Age on Control 47.50 5.84 1.02 0.3475 0.31 1.04 0.3256 0.31
Age on SR 32.38 8.16 1.54 0.1618 0.48 2.37 0.1405 0.48
Simple Effect Age-Sleep on Time=4 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 19.95 10.12 1.19 0.2600 0.34 1.42 0.2844 0.31
Sleep on Old 4.83 6.62 0.10 0.9231 0.03 0.01 0.9198 0.03
Age on Control 47.50 5.84 1.02 0.3475 0.31 1.04 0.3378 0.33
Age on SR 32.38 8.16 1.54 0.1618 0.48 2.37 0.1435 0.50
YSR vs OC 27.55 5.56 0.60 0.5719 0.22 0.36 0.5322 0.21
Simple Effect Age-Sleep on Time=5 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 2.17 0.157 2.17 0.157 3.92 0.0558 NA 1 0.39
Sleep 0.12 0.731 0.12 0.731 0.03 0.8542 NA 0
0.16
Age*Sleep 1.04 0.322 -0.18 0.390 2.70 0.1095 NA 0
0.33
Simple Effect Age-Sleep on Time=5 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 41.57 10.91 1.02 0.3308 0.32 1.04 0.3211 0.32
Sleep on Old -20.33 8.27 -0.45 0.6628 0.17 0.20 0.6507 0.17
Age on Control -13.83 9.59 -0.37 0.7181 0.19 0.14 0.7219 0.18
Age on SR -75.74 9.68 -1.58 0.1469 0.46 2.49 0.1491 0.48
Simple Effect Age-Sleep on Time=5 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 41.57 10.91 1.02 0.3308 0.32 1.04 0.3267 0.32
Sleep on Old -20.33 8.27 -0.45 0.6628 0.17 0.20 0.6429 0.17
Age on Control -13.83 9.59 -0.37 0.7181 0.15 0.14 0.7111 0.18
Age on SR -75.74 9.68 -1.58 0.1469 0.46 2.49 0.1811 0.47
YSR vs OC -55.40 10.86 -1.49 0.1646 0.50 2.22 0.1635 0.53

9 Figure 8. Spindle counts during NREM/REM sigma transitions correlate with memory performance.


Figure 8. Spindle counts during NREM/REM sigma transitions correlate with memory performance. A-F) Spectrograms showing NREM/REM sigma transitions and associated average spindle counts during the same transitions for controls during post-learning (A-B) and experimental and controls groups during recovery (C-F). G-H) Sum of spindle counts during the NREM/REM sigma transitions during post-learning (G) and recovery (H). I) Correlations between OPR memory performance and spindle counts during NREM/REM sigma transitions. Young control (n=11), young SD (n=11), old control (n=8), old SD (n=10). Asterisks (*) represent significance using alpha=0.05. Statistical details in Supplemental Statistical Table corresponding to Figure 8.


9.1 Fig 8G Spnidle Transition PostL {Design 2x(2xS)}

  NmBas="Fig8G SpinTransPostL"
  NmFich<-paste0(PathDesign,"SpindleTransitionPostL.csv");
  NmFAlL<-paste0(PathDesign,NmBas)
  if (!dir.exists(NmFAlL)) {dir.create(NmFAlL)}
  NmFAlL<-paste0(NmFAlL,"/")
    
  DatDTFull <- data.table(read.table(NmFich, header=TRUE, sep=";", na.strings="NA", dec=",",strip.white=TRUE))
  
  DatDT<-DatDTFull[,c(3,7,9:10)]
  setnames(DatDT, "fullname", "Subject")
  
  DatDT$Group<-factor(DatDT$Group);levels(DatDT$Group) <- list("Young Control"="Young_C", "Old Control"="Old_C")
  DatDT$Group<-relevel(DatDT$Group,"Young Control")
  DatDT$Subject<-factor(DatDT$Subject)
    setkey(DatDT,Group)
  
  VIntra=3:4
  NmIntra=names(DatDT[,VIntra,with=F])
  ExtendDT<-reshape(DatDT,direction = "long",varying = list(3:4),idvar = "Subject",
          timevar=c("Moment"),times=NmIntra)
  colnames(ExtendDT)[4] <- "DepVar"
  
  ExtendDT$Group<-factor(ExtendDT$Group);ExtendDT$Group<-relevel(ExtendDT$Group,"Young Control")
  
  ExtendDT$Moment<-factor(ExtendDT$Moment)
  levels(ExtendDT$Moment)<-list("-60 sec to 0"="sum_before", "0 to +60 sec"="sum_after")
    ExtendDT$Group<-relevel(ExtendDT$Group,"Young Control")
    
  ArP<-unlist(lapply(1:2, function (x) lapply(3:4, function(y) DatDT[.(levels(DatDT$Group)[x]),y,with=F][[1]])),recursive = F)
  
  
  Grp<- Grph.3.2Intra(DatP = ExtendDT,"OPR",LblsP =c("Object Exploration", "","Sum of Spindle Counts"),ylmP =c(0,50),hLin = F,lvIp = 2,wMain = F)
 
  levBp<-seq(0.7, 5, by=0.2)
  Grp2<- Grp + 
    geom_signif(annotation=c("","","*"),
              y_position=c(2,2,1),
              xmin=c(levBp[1],levBp[1+5], mean(levBp[c(1,4)])),
              xmax=c(levBp[4],levBp[4+5], mean(levBp[c(1+5,4+5)])), 
              tip_length = c(-0.02, -0.02),vjust=2,textsize=10)
   
   
   # AOV Omnibus
    ResRo<-list()
    RsRb<-bwtrim(2,2,ArP)
    ResRo$w<- c(RsRb$Qa.p.value, RsRb$Qb.p.value, RsRb$Qab.p.value)
    ResRo$BT<-try(c(bwtrimbt(2,2,ArP)))
    APA.N1<-c(round(unlist(RsRb),4),round(unlist(ResRo$BT),4))
    rr<-ExtrSig(ResRo$BT)
    #print(rr)
    
    ResRo$BT_MM<-c(bwtrimbt(2,2,ArP,nboot = 10000))
    rr2=ExtrSig(ResRo$BT_MM)
    #print(rr2)
    
    TamA=round(ESmainMCP(2,2,ArP)$Factor.A[3],3)
        TamB=round(mean(ESmainMCP(2,2,ArP)$Factor.B[,3]),3)
        TamInt=round(mean(esImcp(2,2,ArP)$Effect.Sizes),3)
    
    
    ExRsRbp<-with(RsRb, round(c(Qa.p.value, Qb.p.value,Qab.p.value),4))
    ExRsRbQ<-with(RsRb, round(c(Qa, Qb, Qab),4))
    ExFn<-data.table(ExRsRbQ,ExRsRbp,rr$p.V1,rr$p.Sig,rr2$p.V1,rr2$p.Sig)
    names(ExFn)<-c("Q","p","pBoot","Sig","pBootMas","Sig2")
    ResGen2<-list()
    ResGen2[[1]]<-data.table(Names=c("Age","Phase","Age*Phase"),ExFn)                
    ResGen2[[1]][,EffSize:=c(TamA,TamB,TamInt)]
    AlmacenGen2(GrpP = Grp,Grp2P = Grp2,DataPas = ResGen2,PathDesignP = PathDesign,NmBasP = NmBas,Typ=1)
   
    ExtendDTCol<-copy(ExtendDT)
    ExtendDTCol$Moment<-"All"
    ExtendDTCol<-data.table(rbind(ExtendDT,ExtendDTCol))
    
     Grp3<- Grph.3.2Intra(DatP = ExtendDTCol,"OPR",LblsP =c("Object Exploration", "A","Sum of spindle counts"),ylmP =c(0,50),hLin = F,lvIp = 3,wMain = T)
  
    pdf(paste0(NmFAlL,NmBas,"OtrosGraphs.pdf"))
      Grp3
    dev.off()
    
    #Results
    plot(Grp)
    plot(Grp2)
    plot(Grp3)
    ResGen2
    
    Kbl3(ResGen2[[1]], "Omnibus AOV. Design 2x2")
[1] "Taking bootstrap samples. Please wait."
[1] "Taking bootstrap samples. Please wait."
quartz_off_screen 
                2 
[[1]]
       Names       Q      p  pBoot   Sig pBootMas  Sig2 EffSize
1:       Age  0.9365 0.3569 0.3873         0.3642         0.226
2:     Phase 52.8448 0.0000 0.0000 *       0.0001 *       0.933
3: Age*Phase  0.2552 0.6228 0.5993         0.6179         0.186
Omnibus AOV. Design 2x2
Names Q p pBoot Sig pBootMas Sig2 EffSize
Age 0.9365 0.3569 0.3873 0.3642 0.226
Phase 52.8448 0.0000 0.0000
0.0001
0.933
Age*Phase 0.2552 0.6228 0.5993 0.6179 0.186

9.2 Fig 8H Spnidle Transition Recover {Design 2x2x(2xS)}

    NmBas="Fig8H SpinTransRecover"
    NmFAlL<-paste0(PathDesign,NmBas)
    if (!dir.exists(NmFAlL)) {dir.create(NmFAlL)}
    NmFAlL<-paste0(NmFAlL,"/")
    ResGen<-NA
    
    rrt<-ExDataIS.2(nmF = paste0(PathDesign,"SpindleTransitionRecover.csv"),Vars = c(4,5,7,9:10),vIntP =c(4:5),lvlCh = list("T1"="sum_before","T2"="sum_after"))
  DatDT<-rrt$DT
  ArP<-rrt$Arp
  ExtendDT<-rrt$ExtendDT
  
  # For Simple Effects:
  DatEfS<-list()
  for(is in 1:2) {
    DatEfS[[is]]<-ExData.2(nmF = paste0(PathDesign,"SpindleTransitionRecover.csv"),Vars = c(4:5,(8+is)))
    names(DatEfS[[is]]$DT)[3]<-"DepV"
  }
  
  ExtendDTv2<-copy(ExtendDT)
  levels(ExtendDTv2$Moment) <- list("-60 sec to 0"="T1", "0 to +60 sec"="T2")

  Grp<- Grph.3(DatP = ExtendDTv2,"OPR",LblsP =c("Object Exploration", "","Sum of Spindle Counts"),ylmP =c(0,50),hLin = F,lvIp = 2,wMain = F)

  levBp<-seq(0.7, 5, by=0.2)
  Grp2<- Grp + 
    geom_signif(annotation=c("*"),
              y_position=c(48),
              xmin=c(levBp[1]),
              xmax=c(levBp[2]), 
              tip_length = c(0.02, 0.02),vjust=0.5,textsize=10) +
    geom_signif(annotation=c("*"),
              y_position=c(45),
              xmin=c(levBp[2]),
              xmax=c(levBp[4]), 
              tip_length = c(0.02, 0.02),vjust=0.5,textsize=10) +
    geom_signif(annotation=c("*"),
              y_position=c(48),
              xmin=c(levBp[1+5]),
              xmax=c(levBp[2+5]), 
              tip_length = c(0.02, 0.02),vjust=0.5,textsize=10) +
    geom_signif(annotation=c("*"),
              y_position=c(45),
              xmin=c(levBp[2+5]),
              xmax=c(levBp[4+5]), 
              tip_length = c(0.02, 0.02),vjust=0.5,textsize=10) +
    geom_signif(annotation=c("","","*"),
              y_position=c(2,2,1),
              xmin=c(levBp[1],levBp[1+5], mean(levBp[c(1,4)])),
              xmax=c(levBp[4],levBp[4+5], mean(levBp[c(1+5,4+5)])), 
              tip_length = c(-0.02, -0.02),vjust=2,textsize=10)
    
   
  #AOV
  #A=2;B=2;C=2;DatPas=rrt;DatEfSp=DatEfS;nBMM1=nBMM2=1000;Prc = 2
  names(rrt$DT)[4:5]<-c("T1","T2")
  ResGen<-AOVMx2.2(A=2,B=2,C=2,DatPas = rrt,DatEfSp = DatEfS,nBMM1 = 10000,nBMM2 = 1000,Prc = 2)
  AlmacenGen2(GrpP = Grp,Grp2P = Grp2,DataPas = ResGen,PathDesignP = PathDesign,NmBasP = NmBas,Typ=2)
  
  # Other Graphs
    GrpO<-Grph.3.Otros(ExtendDT,LblsP =c("Object Exploration", "A","Similarity Score"))
   
    ExtendDTCol<-copy(ExtendDTv2)
    ExtendDTCol$Moment<-"All"
    ExtendDTCol<-data.table(rbind(ExtendDTv2,ExtendDTCol))
    Grp3<-Grph.3(DatP = ExtendDTCol,"OPR",LblsP =c("Object Exploration", "A","Sum of spindle counts"),ylmP =c(0,50),hLin = F,lvIp = 3,wMain = T)
    
    pdf(paste0(NmFAlL,NmBas,"OtrosGraphs.pdf"))
      Grp3
      GrpO
    dev.off()
    
    # Results
        
        # Results
        plot(Grp)
        plot(Grp2) # Only this graph is printed in the html file.
        plot(Grp3)
        GrpO
        ResGen # Lean option to view the results of statistical analysis
        
        Kbl3(ResPas = ResGen[[1]], lbl = "Omnibus AOV. Design 2x2x(2xS)");cat("\n")
        Kbl3(ResGen[[2]], "Interaction Age-Sleep. Design 2x2x(2xS)")
        Kbl3(ResGen[[3]], "Interaction Age-Time. Design 2x2x(2xS)")
        Kbl3(ResGen[[4]], "Interaction Sleep-Time. Design 2x2x(2xS)")
        Kbl3(ResGen[[5]], "Main Effect Time. Design 2x2x(2xS)")
        Kbl3(ResGen[[6]], "Simple Effect Time each Age-Sleep condition. Design 2x2x(2xS)")
        Kbl3(ResGen[[7]][[1]][[1]], "Simple Effect Age-Sleep on Time=1 Omnibus AOV. Design 2x2x(2xS)")
        Kbl3(ResGen[[7]][[1]][[2]], "Simple Effect Age-Sleep on Time=1 Simple Effects. Design 2x2x(2xS)")
        Kbl3(ResGen[[7]][[1]][[3]], "Simple Effect Age-Sleep on Time=1 Extense Simple Effects. Design 2x2x(2xS)")
        Kbl3(ResGen[[7]][[2]][[1]], "Simple Effect Age-Sleep on Time=2 Omnibus AOV. Design 2x2x(2xS)")
        Kbl3(ResGen[[7]][[2]][[2]], "Simple Effect Age-Sleep on Time=2 Simple Effects. Design 2x2x(2xS)")
        Kbl3(ResGen[[7]][[2]][[3]], "Simple Effect Age-Sleep on Time=2 Extense Simple Effects. Design 2x2x(2xS)")
           Eff   p.V1 p.Sig
1:   p.value.A 0.0818      
2:   p.value.B 0.1619      
3:   p.value.C 0.0000 *    
4:  p.value.AB 0.0401 *    
5:  p.value.AC 0.3072      
6:  p.value.BC 0.8381      
7: p.value.ABC 0.3856      
           Eff   p.V1 p.Sig
1:   p.value.A 0.0681      
2:   p.value.B 0.1811      
3:   p.value.C 0.0000 *    
4:  p.value.AB 0.0401 *    
5:  p.value.AC 0.3027      
6:  p.value.BC 0.8255      
7: p.value.ABC 0.3741      
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "This version returns an effect size similar to what is used by yuenv2"
[1] "To get a measure of effect size based on the difference scores, use trimciv2"
$BP

$Bars

$MargAB

$MargAC

$MargBC

$MargC

quartz_off_screen 
                2 
$BP

$Bars

$MargAB

$MargAC

$MargBC

$MargC

$AOV
            Names      Q      p  pBoot   Sig pBootMas  Sig2
1:            Age   3.33 0.0682 0.0818         0.0681      
2:          Sleep   1.80 0.1805 0.1619         0.1811      
3:           Time 259.31 0.0000 0.0000 *       0.0000 *    
4:      Age*Sleep   4.38 0.0366 0.0401 *       0.0401 *    
5:       Age*Time   1.08 0.2998 0.3072         0.3027      
6:     Sleep*Time   0.05 0.8271 0.8381         0.8255      
7: Age*Sleep*Time   0.79 0.3730 0.3856         0.3741      

$InterAB
            Contr psihat    df  test p.value EfSize.V1
1: Sleep on Young  12.35 17.24  2.70  0.0152      0.78
2:   Sleep on Old  -2.71 16.32 -0.54  0.5948      0.23
3: Age on Control   0.96 17.98  0.25  0.8090      0.13
4:      Age on SR -14.10 18.50 -2.55  0.0198      0.98

$InterAC
            Contr psihat    df  test p.value EfSize.V1
1:      Age on M1  -9.85 16.98 -1.93  0.0701      0.57
2:      Age on M2  -3.29 16.65 -0.74  0.4717      0.23
3: M1-M2 on Young  45.70    NA 12.15  0.0001      0.94
4:   M1-M2 on Old  48.53    NA  6.70  0.0011      0.96

$InterBC
              Contr psihat    df  test p.value EfSize.V1
1:      Sleep on M1   4.13 16.98  0.81  0.4288      0.22
2:      Sleep on M2   5.51 16.65  1.23  0.2341      0.39
3: M1-M2 on Control  48.46    NA 12.39  0.0001      0.98
4:      M1-M2 on SR  44.46    NA  5.09  0.0038      0.94

$DetallMainC
   Contr psihat test p.value Psihat2 p.value2 EfSize.V1
1: M1-M2  91.91  8.3   4e-04  101.85        0      0.97

$DetallTrialCadaCondAB
           Contr psihat df  test p.value Psihat2 p.value2 dif.yuen df.yuen
1:  M1-M2 on Y_C  23.72 NA  5.61  0.0025   24.89        0    24.89       5
2: M1-M2 on Y_SR  20.55 NA  5.15  0.0036   22.76        0    22.76       6
3:  M1-M2 on O_C  24.33 NA 10.20  0.0002   25.35        0    25.35       5
4: M1-M2 on O_SR  24.87 NA  4.62  0.0057   28.86        0    28.86       5
   test.yuen EffSize.yuen pvaluet.yuen
1:      9.46         0.99       0.0002
2:      5.77         0.94       0.0012
3:     13.32         0.97       0.0000
4:      7.74         0.85       0.0006

$DetallSimple
$DetallSimple[[1]]
$DetallSimple[[1]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 3.74 0.069   3.74  0.069  3.38 0.0752 0.0968        0.058       
2:     Sleep 0.66 0.429   0.66  0.429  0.63 0.4339 0.4424        0.416       
3: Age*Sleep 4.12 0.057  -0.36  0.060  4.18 0.0491 0.1319        0.047  *    
   EffSize
1:    0.57
2:    0.18
3:    0.61

$DetallSimple[[1]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   7.24 10.11  1.88  0.0895      0.60      3.53 0.0911
2:   Sleep on Old  -3.11  6.90 -0.93  0.3822      0.28      0.87 0.3608
3: Age on Control   0.25  8.45  0.10  0.9239      0.14      0.01 0.9244
4:      Age on SR -10.10 10.98 -2.28  0.0433      0.56      5.21 0.0656
   EffSize.Boot
1:         0.57
2:         0.31
3:         0.12
4:         1.04

$DetallSimple[[1]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   7.24 10.11  1.88  0.0895      0.60      3.53 0.0867
2:   Sleep on Old  -3.11  6.90 -0.93  0.3822      0.29      0.87 0.3811
3: Age on Control   0.25  8.45  0.10  0.9239      0.11      0.01 0.9210
4:      Age on SR -10.10 10.98 -2.28  0.0433      0.56      5.21 0.0556
5:      YSR vs OC  -6.99  8.02 -2.01  0.0795      0.60      4.03 0.0868
   EffSize.Boot
1:         0.57
2:         0.31
3:         0.14
4:         1.04
5:         0.61


$DetallSimple[[2]]
$DetallSimple[[2]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 0.54 0.472   0.54  0.472  0.82 0.3723 0.4858        0.474       
2:     Sleep 1.52 0.234   1.52  0.234  3.09 0.0884 0.2354        0.211       
3: Age*Sleep 1.11 0.306  -0.21  0.250  1.28 0.2659 0.4240        0.296       
   EffSize
1:    0.23
2:    0.38
3:    0.38

$DetallSimple[[2]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   5.11 10.12  2.07  0.0654      0.68      4.27 0.0612
2:   Sleep on Old   0.40  9.46  0.11  0.9163      0.10      0.01 0.9167
3: Age on Control   0.71  9.70  0.24  0.8169      0.19      0.06 0.8176
4:      Age on SR  -4.00  7.74 -1.21  0.2635      0.46      1.45 0.2767
   EffSize.Boot
1:         0.68
2:         0.10
3:         0.20
4:         0.46

$DetallSimple[[2]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   5.11 10.12  2.07  0.0654      0.68      4.27 0.0600
2:   Sleep on Old   0.40  9.46  0.11  0.9163      0.12      0.01 0.9210
3: Age on Control   0.71  9.70  0.24  0.8169      0.15      0.06 0.8267
4:      Age on SR  -4.00  7.74 -1.21  0.2635      0.47      1.45 0.2469
5:      YSR vs OC  -4.40  9.09 -1.59  0.1468      0.70      2.52 0.1435
   EffSize.Boot
1:         0.68
2:         0.10
3:         0.19
4:         0.46
5:         0.69
Omnibus AOV. Design 2x2x(2xS)
Names Q p pBoot Sig pBootMas Sig2
Age 3.33 0.0682 0.0818 0.0681
Sleep 1.80 0.1805 0.1619 0.1811
Time 259.31 0.0000 0.0000
0.0000
Age*Sleep 4.38 0.0366 0.0401
0.0401
Age*Time 1.08 0.2998 0.3072 0.3027
Sleep*Time 0.05 0.8271 0.8381 0.8255
AgeSleepTime 0.79 0.3730 0.3856 0.3741
Interaction Age-Sleep. Design 2x2x(2xS)
Contr psihat df test p.value EfSize.V1
Sleep on Young 12.35 17.24 2.70 0.0152 0.78
Sleep on Old -2.71 16.32 -0.54 0.5948 0.23
Age on Control 0.96 17.98 0.25 0.8090 0.13
Age on SR -14.10 18.50 -2.55 0.0198 0.98
Interaction Age-Time. Design 2x2x(2xS)
Contr psihat df test p.value EfSize.V1
Age on M1 -9.85 16.98 -1.93 0.0701 0.57
Age on M2 -3.29 16.65 -0.74 0.4717 0.23
M1-M2 on Young 45.70 NA 12.15 0.0001 0.94
M1-M2 on Old 48.53 NA 6.70 0.0011 0.96
Interaction Sleep-Time. Design 2x2x(2xS)
Contr psihat df test p.value EfSize.V1
Sleep on M1 4.13 16.98 0.81 0.4288 0.22
Sleep on M2 5.51 16.65 1.23 0.2341 0.39
M1-M2 on Control 48.46 NA 12.39 0.0001 0.98
M1-M2 on SR 44.46 NA 5.09 0.0038 0.94
Main Effect Time. Design 2x2x(2xS)
Contr psihat test p.value Psihat2 p.value2 EfSize.V1
M1-M2 91.91 8.3 4e-04 101.85 0 0.97
Simple Effect Time each Age-Sleep condition. Design 2x2x(2xS)
Contr psihat df test p.value Psihat2 p.value2 dif.yuen df.yuen test.yuen EffSize.yuen pvaluet.yuen
M1-M2 on Y_C 23.72 NA 5.61 0.0025 24.89 0 24.89 5 9.46 0.99 0.0002
M1-M2 on Y_SR 20.55 NA 5.15 0.0036 22.76 0 22.76 6 5.77 0.94 0.0012
M1-M2 on O_C 24.33 NA 10.20 0.0002 25.35 0 25.35 5 13.32 0.97 0.0000
M1-M2 on O_SR 24.87 NA 4.62 0.0057 28.86 0 28.86 5 7.74 0.85 0.0006
Simple Effect Age-Sleep on Time=1 Omnibus AOV. Design 2x2x(2xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 3.74 0.069 3.74 0.069 3.38 0.0752 0.0968 0.058 0.57
Sleep 0.66 0.429 0.66 0.429 0.63 0.4339 0.4424 0.416 0.18
Age*Sleep 4.12 0.057 -0.36 0.060 4.18 0.0491 0.1319 0.047
0.61
Simple Effect Age-Sleep on Time=1 Simple Effects. Design 2x2x(2xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 7.24 10.11 1.88 0.0895 0.60 3.53 0.0911 0.57
Sleep on Old -3.11 6.90 -0.93 0.3822 0.28 0.87 0.3608 0.31
Age on Control 0.25 8.45 0.10 0.9239 0.14 0.01 0.9244 0.12
Age on SR -10.10 10.98 -2.28 0.0433 0.56 5.21 0.0656 1.04
Simple Effect Age-Sleep on Time=1 Extense Simple Effects. Design 2x2x(2xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 7.24 10.11 1.88 0.0895 0.60 3.53 0.0867 0.57
Sleep on Old -3.11 6.90 -0.93 0.3822 0.29 0.87 0.3811 0.31
Age on Control 0.25 8.45 0.10 0.9239 0.11 0.01 0.9210 0.14
Age on SR -10.10 10.98 -2.28 0.0433 0.56 5.21 0.0556 1.04
YSR vs OC -6.99 8.02 -2.01 0.0795 0.60 4.03 0.0868 0.61
Simple Effect Age-Sleep on Time=2 Omnibus AOV. Design 2x2x(2xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.54 0.472 0.54 0.472 0.82 0.3723 0.4858 0.474 0.23
Sleep 1.52 0.234 1.52 0.234 3.09 0.0884 0.2354 0.211 0.38
Age*Sleep 1.11 0.306 -0.21 0.250 1.28 0.2659 0.4240 0.296 0.38
Simple Effect Age-Sleep on Time=2 Simple Effects. Design 2x2x(2xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 5.11 10.12 2.07 0.0654 0.68 4.27 0.0612 0.68
Sleep on Old 0.40 9.46 0.11 0.9163 0.10 0.01 0.9167 0.10
Age on Control 0.71 9.70 0.24 0.8169 0.19 0.06 0.8176 0.20
Age on SR -4.00 7.74 -1.21 0.2635 0.46 1.45 0.2767 0.46
Simple Effect Age-Sleep on Time=2 Extense Simple Effects. Design 2x2x(2xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 5.11 10.12 2.07 0.0654 0.68 4.27 0.0600 0.68
Sleep on Old 0.40 9.46 0.11 0.9163 0.12 0.01 0.9210 0.10
Age on Control 0.71 9.70 0.24 0.8169 0.15 0.06 0.8267 0.19
Age on SR -4.00 7.74 -1.21 0.2635 0.47 1.45 0.2469 0.46
YSR vs OC -4.40 9.09 -1.59 0.1468 0.70 2.52 0.1435 0.69

9.3 Fig 8I Pearson r Correlations {Design 2x2}

  NmBas="Fig8I Correlations"
  NmFAlL<-paste0(PathDesign,NmBas)
  if (!dir.exists(NmFAlL)) {dir.create(NmFAlL)}
  NmFAlL<-paste0(NmFAlL,"/")
  
  DatDTRes<-list()
  
  NameF<-paste0(PathDesign,"SpindleTransitionRecoverBehavior.csv")
  DatDTFullp <- data.table(read.table(NameF, header=TRUE, sep=";", na.strings="NA", dec=",",strip.white=TRUE))
  DatDTFullp$subtype<-factor(DatDTFullp$subtype)
  co<-list()
  co$cor<-cor(DatDTFullp[,8:10],use="pairwise.complete.obs")
  result <- by(DatDTFullp[,8:10], DatDTFullp$subtype, function(x) {cor(x$sum_before, x$Behavior)})
  result.dataframe <- as.data.frame(as.matrix(result))
  result.dataframe$C <- rownames(result)
  result.dataframe$Grp<-as.factor(c("PostLearning","Recovery","Recovery","PostLearning","Recovery","Recovery"))
  
  DTTibb<-as_tibble(DatDTFullp)
  DTTibb$age<-as.factor(DTTibb$age); relevel(DTTibb$age,"Y")
  DTTibb$Inter<-interaction(DTTibb$age,DTTibb$type,sep=",")
  
  DTTibb$Inter<-factor(DTTibb$Inter,levels=c("Y,C","Y,D","O,C","O,D"))
  DTTibbR<-DTTibb %>%
    dplyr::select(period,Inter,sum_before, Behavior) %>%
    dplyr::group_by(period,Inter) %>%
    dplyr::summarise(R=cor.test(sum_before,Behavior)[["estimate"]],
                      p=cor.test(sum_before,Behavior)[["p.value"]],.groups = 'drop')

  

 DTTibbR$period<-as.factor(DTTibbR$period)
 levels(DTTibbR$period)=list('Post-Learning'='P',"Recovery"='R')
 DTTibbR$p<-round(DTTibbR$p,2)
 DTTibbR$p<-c('0.03*', '0.06', '0.09', '0.0009*', '0.16', '0.0004*')

  pdf(paste0(NmFAlL,NmBas,"Graphs.pdf"),family = "ArialMT")
      dotchart(DTTibbR$R, labels = DTTibbR$Inter ,
         cex = 1.5, xlab = "",xlim=c(0,1.1),groups = DTTibbR$period,color="black",pch=19)
    text(x = DTTibbR$R [c(3,4,5,6,1,2)],
     y = c(1:4,7:8),
     labels= paste0("p=",DTTibbR$p[c(3,4,5,6,1,2)]),
     cex = 1,
     pos = 4)
  dev.off()

    bp<-ggplot(DTTibbR, aes(x = Inter, y = R )) 
    bpp<-bp + geom_segment( aes(x=Inter,xend=Inter, y=0, yend=R), color="grey") +
    geom_point(size=5, color=c("blue","blue","red","red","red","red")) +
    coord_flip() +
  theme_ipsum() +
    theme(
      panel.grid.minor.y = element_blank(),
      panel.grid.major.y = element_blank(),
      panel.grid.major.x = element_line(colour = "darkgrey"),
       panel.grid.minor.x = element_line(colour = "grey"),
      axis.text = element_text( size=48 )
    ) +
    ylim(0,1) +
    ylab("") +
    xlab("") + ggtitle("") +
   annotate("text", x = c(1,3,1,2,3,4)+.15,
     y = DTTibbR$R+c(0,0,-.05,-.05,-.05,-.05),
     label= paste0("p=",DTTibbR$p))

  
  
  # Results
  # Type 1 Graph Pearson r Correlation
  dotchart(DTTibbR$R, labels = DTTibbR$Inter ,
         cex = 1.5, xlab = "",xlim=c(0,1.1),groups = DTTibbR$period,color="black",pch=19)
  text(x = DTTibbR$R [c(3,4,5,6,1,2)],
     y = c(1:4,7:8),
     labels= paste0("p=",DTTibbR$p[c(3,4,5,6,1,2)]),
     cex = 1,
     pos = 4)  

  # Type 2 Graph Pearson r Correlation
  plot(bpp)
 [1] Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y O O O O O O O O O O O O O O O O
[39] O O Y Y Y Y Y Y Y Y Y O O O O O O O O
Levels: Y O
quartz_off_screen 
                2 

10 Supplemental Figure 1. Electrode placement and place cell parameters recorded.


Supplemental Figure 1. Schematic of electrode placement and place cell parameters recorded during OPR performance. A) Schematic of electrode placements (red dots) and microphotograph showing sample lesion marking electrode placement in CA1. B-D) Mean (B), peak (C), and out of field (D) firing rate for all groups across trials. There were no differences in mean or peak firing rate between the groups throughout training (p>0.05). However, there were increases in firing rate that persisted during training (T1 to T3) when the objects were introduced across all groups [MFR: Fw(4)=1.14, p<0.007; PFR: Fw(4)=1.11, p<0.02 . Analysis of simple effects indicated that all groups displayed higher mean and peak firing rate during the first object trial and test trials (MFR: Hab xT1: Zw=1.73, p<0.04; T3 x Test: Zw=3.16, p<0.04; PFR: Hab xT1: Zw=2.08, p<0.02; T3 x Test: Zw=0.96, p<0.05]. No differences were observed in out-of- field firing rate. E-G) There were no differences during training or testing in other place cell parameters, including number of fields (E), field size (F), and spatial information content (G, p>0.05). Hab: habituation, T1-T3: training trials. Asterisks (*) represent significance using alpha=0.05. Statistical details in Supplemental Statistical Table corresponding to Supplemental Figure 1.


10.1 Fig S1B Mean firing rate {Design 2x2x(5xS)}

  NmBas="FigS1B MeanFiringRate"
  NmFAlL<-paste0(PathDesign,NmBas)
  if (!dir.exists(NmFAlL)) {dir.create(NmFAlL)}
  NmFAlL<-paste0(NmFAlL,"/")
  ResGen<-NA
  
  rrt<-ExDataIS.2(nmF = paste0(PathDesign,"Parameters.csv"),Vars = c(1,5,6,7:11),vIntP =c(4:8),lvlCh = list("HAB"="mfr_s1", "T1"="mfr_s2","T2"="mfr_s3","T3"="mfr_s4","Test"="mfr_s5"))
  DatDT<-rrt$DT
  ArP<-rrt$Arp
  ExtendDT<-rrt$ExtendDT
  
  # Simple Effects:
  DatEfS<-list()
  for(is in 1:5) {
    DatEfS[[is]]<-ExData.2(nmF = paste0(PathDesign,"Parameters.csv"),Vars = c(5:6,(6+is)))
    names(DatEfS[[is]]$DT)[3]<-"DepV"
  }
  
  #Graphs
  Grp<- Grph.3(DatP = ExtendDT,"OPR",LblsP =c("Object Exploration", "","Mean FR (Hz)"),ylmP =c(0,1.5),hLin = F,lvIp=5)

  levBp<-seq(0.7, 6, by=0.2)
  Grp2<- Grp + 
    geom_signif(annotation=c("","","*"),
              y_position=c(1.4,1.4,1.5),
              xmin=c(levBp[1],levBp[1+5], mean(levBp[c(1,4)])),
              xmax=c(levBp[4],levBp[4+5], mean(levBp[c(1+5,4+5)])), 
              tip_length = c(0.02, 0.02),textsize=6)+
    geom_signif(annotation=c("","","*"),
              y_position=c(1.4,1.4,1.5),
              xmin=c(levBp[1+15],levBp[1+20], mean(levBp[c(1+15,4+15)])),
              xmax=c(levBp[4+15],levBp[4+20], mean(levBp[c(1+20,4+20)])), 
              tip_length = c(0.02, 0.02),textsize=6)
  
    #AOV
    names(rrt$DT)[4:8]<-c("T1","T2","T3","T4","T5")
    ResGen<-AOVMx2.5(A=2,B=2,C=5,DatPas = rrt,DatEfSp = DatEfS,nBMM1 = 10000,nBMM2 = 1000,Prc = 2)
    AlmacenGen2(GrpP = Grp,Grp2P = Grp2,DataPas = ResGen,PathDesignP = PathDesign,NmBasP = NmBas,Typ=2)
  
  # Other Graphs
    GrpO<-Grph.3.Otros(ExtendDT,LblsP =c("Object Exploration", "B","Mean FR (Hz)"))
 
    ExtendDTCol<-copy(ExtendDT)
    ExtendDTCol$Moment<-"All"
    ExtendDTCol<-data.table(rbind(ExtendDT,ExtendDTCol))
    
    Grp3<-Grph.3(DatP = ExtendDTCol,"OPR",LblsP =c("Object Exploration", "B","Mean FR (Hz)"),ylmP =c(0,1.5),hLin = F,lvIp = 6,wMain = T)
   
    pdf(paste0(NmFAlL,NmBas,"OtrosGraphs.pdf"))
      Grp3
      GrpO
    dev.off()
    
    # Results
        # Results
        plot(Grp)
        plot(Grp2) # Only this graph is printed in the html file.
        GrpO
        plot(Grp3)
        ResGen # Lean option to view the results of statistical analysis
        
        Kbl3(ResPas = ResGen[[1]], lbl = "Omnibus AOV. Design 2x2x(5xS)");cat("\n")
        Kbl3(ResGen[[2]], "Interaction Age-Sleep. Design 2x2x(5xS)")
        Kbl3(ResGen[[3]], "Interaction Age-Time. Design 2x2x(5xS)")
        Kbl3(ResGen[[4]], "Interaction Sleep-Time. Design 2x2x(5xS)")
        Kbl3(ResGen[[5]], "Main Effect Time. Design 2x2x(5xS)")
        Kbl3(ResGen[[6]], "Simple Effect Time each Age-Sleep condition. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[1]][[1]], "Simple Effect Age-Sleep on Time=1 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[1]][[2]], "Simple Effect Age-Sleep on Time=1 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[1]][[3]], "Simple Effect Age-Sleep on Time=1 Extense Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[2]][[1]], "Simple Effect Age-Sleep on Time=2 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[2]][[2]], "Simple Effect Age-Sleep on Time=2 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[2]][[3]], "Simple Effect Age-Sleep on Time=2 Extense Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[3]][[1]], "Simple Effect Age-Sleep on Time=3 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[3]][[2]], "Simple Effect Age-Sleep on Time=3 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[3]][[3]], "Simple Effect Age-Sleep on Time=3 Extense Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[4]][[1]], "Simple Effect Age-Sleep on Time=4 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[4]][[2]], "Simple Effect Age-Sleep on Time=4 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[4]][[3]], "Simple Effect Age-Sleep on Time=4 Extense Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[5]][[1]], "Simple Effect Age-Sleep on Time=5 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[5]][[2]], "Simple Effect Age-Sleep on Time=5 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[5]][[3]], "Simple Effect Age-Sleep on Time=5 Extense Simple Effects. Design 2x2x(5xS)")
           Eff   p.V1 p.Sig
1:   p.value.A 0.4708      
2:   p.value.B 0.7696      
3:   p.value.C 0.0167 *    
4:  p.value.AB 0.5259      
5:  p.value.AC 0.5960      
6:  p.value.BC 0.5643      
7: p.value.ABC 0.4925      
           Eff   p.V1 p.Sig
1:   p.value.A 0.4842      
2:   p.value.B 0.7631      
3:   p.value.C 0.0345 *    
4:  p.value.AB 0.4801      
5:  p.value.AC 0.6670      
6:  p.value.BC 0.6440      
7: p.value.ABC 0.5672      
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
$BP

$Bars

$MargAB

$MargAC

$MargBC

$MargC

quartz_off_screen 
                2 
$BP

$Bars

$MargAB

$MargAC

$MargBC

$MargC

$AOV
            Names    Q      p  pBoot   Sig pBootMas  Sig2
1:            Age 0.48 0.4886 0.4708         0.4842      
2:          Sleep 0.09 0.7658 0.7696         0.7631      
3:           Time 1.14 0.3383 0.0167 *       0.0345 *    
4:      Age*Sleep 0.37 0.5457 0.5259         0.4801      
5:       Age*Time 0.25 0.9113 0.5960         0.6670      
6:     Sleep*Time 0.26 0.9032 0.5643         0.6440      
7: Age*Sleep*Time 0.31 0.8731 0.4925         0.5672      

$InterAB
            Contr psihat     df  test p.value EfSize.V1
1: Sleep on Young  -0.09 287.49 -0.42  0.6731      0.06
2:   Sleep on Old   0.26 198.13  1.12  0.2639      0.04
3: Age on Control  -0.38 208.58 -1.64  0.1019      0.17
4:      Age on SR  -0.03 248.53 -0.12  0.9053      0.07

$InterAC
             Contr psihat     df  test p.value EfSize.V1
 1:      Age on M1  -0.09  81.88 -0.68  0.4994      0.08
 2:      Age on M2  -0.08  90.03 -0.50  0.6171      0.05
 3:      Age on M3  -0.11 104.49 -0.73  0.4695      0.07
 4:      Age on M4  -0.17  97.14 -1.25  0.2153      0.14
 5:      Age on M5   0.04  93.95  0.33  0.7453      0.06
 6: M1-M2 on Young  -0.10     NA -1.12  0.2761      0.11
 7:   M1-M2 on Old  -0.06     NA -0.66  0.5151      0.09
 8: M2-M3 on Young  -0.06     NA -1.04  0.3112      0.02
 9:   M2-M3 on Old  -0.07     NA -0.98  0.3363      0.05
10: M3-M4 on Young   0.11     NA  1.66  0.1125      0.09
11:   M3-M4 on Old   0.07     NA  1.20  0.2427      0.07
12: M4-M5 on Young  -0.02     NA -0.26  0.7992      0.00
13:   M4-M5 on Old   0.29     NA  2.83  0.0100      0.20

$InterBC
             Contr psihat     df  test p.value EfSize.V1
 1:    Sleep on M1  -0.10  81.88 -0.73  0.4690      0.09
 2:    Sleep on M2   0.06  90.03  0.34  0.7331      0.02
 3:    Sleep on M3   0.10 104.49  0.65  0.5187      0.04
 4:    Sleep on M4   0.08  97.14  0.60  0.5513      0.04
 5:    Sleep on M5   0.04  93.95  0.31  0.7583      0.04
 6: M1-M2 on Young  -0.22     NA -3.50  0.0021      0.16
 7:   M1-M2 on Old  -0.01     NA -0.09  0.9285      0.04
 8: M2-M3 on Young  -0.03     NA -0.31  0.7607      0.03
 9:   M2-M3 on Old  -0.10     NA -1.99  0.0594      0.02
10: M3-M4 on Young   0.11     NA  1.39  0.1779      0.08
11:   M3-M4 on Old   0.12     NA  2.12  0.0459      0.08
12: M4-M5 on Young   0.22     NA  2.65  0.0149      0.09
13:   M4-M5 on Old   0.15     NA  2.06  0.0518      0.08

$DetallMainC
   Contr psihat  test p.value Psihat2 p.value2 EfSize.V1
1: M1-M2  -0.19 -1.73  0.0989   -0.27    0.020      0.10
2: M2-M3  -0.21 -2.02  0.0566   -0.09    0.384      0.04
3: M3-M4   0.17  1.32  0.2006    0.20    0.056      0.08
4: M4-M5   0.34  3.16  0.0048    0.23    0.064      0.09

$DetallTrialCadaCondAB
            Contr psihat df  test p.value Psihat2 p.value2 dif.yuen df.yuen
 1:  M1-M2 on Y_C  -0.08 NA -1.24  0.2282   -0.11    0.040    -0.11      35
 2: M1-M2 on Y_SR  -0.01 NA -0.23  0.8238   -0.03    0.688    -0.03      29
 3:  M1-M2 on O_C  -0.14 NA -2.96  0.0075   -0.10    0.140    -0.10      21
 4: M1-M2 on O_SR   0.04 NA  0.54  0.5967   -0.03    0.700    -0.03      24
 5:  M2-M3 on Y_C   0.02 NA  0.29  0.7733    0.01    0.852     0.01      35
 6: M2-M3 on Y_SR  -0.05 NA -1.68  0.1083   -0.04    0.348    -0.04      29
 7:  M2-M3 on O_C  -0.06 NA -0.93  0.3635   -0.07    0.316    -0.07      21
 8: M2-M3 on O_SR  -0.04 NA -0.92  0.3679    0.02    0.792     0.02      24
 9:  M3-M4 on Y_C   0.04 NA  0.92  0.3686    0.06    0.124     0.06      35
10: M3-M4 on Y_SR   0.05 NA  1.93  0.0676    0.07    0.012     0.07      29
11:  M3-M4 on O_C   0.08 NA  1.78  0.0889    0.05    0.488     0.05      21
12: M3-M4 on O_SR   0.03 NA  0.83  0.4176    0.02    0.664     0.02      24
13:  M4-M5 on Y_C   0.01 NA  0.22  0.8258   -0.03    0.628    -0.03      35
14: M4-M5 on Y_SR   0.01 NA  0.29  0.7709    0.04    0.392     0.04      29
15:  M4-M5 on O_C   0.19 NA  3.68  0.0014    0.16    0.012     0.16      21
16: M4-M5 on O_SR   0.11 NA  1.64  0.1150    0.06    0.396     0.06      24
    test.yuen EffSize.yuen pvaluet.yuen
 1:     -1.93         0.17       0.0619
 2:     -0.46         0.04       0.6523
 3:     -1.40         0.14       0.1765
 4:     -0.50         0.05       0.6186
 5:      0.23         0.01       0.8231
 6:     -0.94         0.06       0.3542
 7:     -1.09         0.10       0.2874
 8:      0.41         0.03       0.6885
 9:      1.39         0.09       0.1748
10:      2.10         0.10       0.0443
11:      0.65         0.08       0.5232
12:      0.41         0.04       0.6857
13:     -0.47         0.04       0.6408
14:      0.94         0.06       0.3558
15:      2.28         0.30       0.0329
16:      0.73         0.10       0.4731

$DetallSimple
$DetallSimple[[1]]
$DetallSimple[[1]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 0.46 0.500   0.46  0.500  0.20 0.6559 0.4891        0.504       
2:     Sleep 0.53 0.469   0.53  0.469  0.58 0.4490 0.4841        0.471       
3: Age*Sleep 0.10 0.753   0.04  0.630  0.14 0.7111 0.8364        0.738       
   EffSize
1:    0.08
2:    0.10
3:    0.04

$DetallSimple[[1]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.07 63.87 -0.91  0.3644      0.13      0.83 0.3744
2:   Sleep on Old  -0.03 43.04 -0.25  0.8032      0.05      0.06 0.8200
3: Age on Control  -0.07 40.45 -0.66  0.5146      0.12      0.43 0.5233
4:      Age on SR  -0.02 44.40 -0.28  0.7831      0.05      0.08 0.7756
   EffSize.Boot
1:         0.14
2:         0.05
3:         0.10
4:         0.05

$DetallSimple[[1]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.07 63.87 -0.91  0.3644      0.11      0.83 0.3633
2:   Sleep on Old  -0.03 43.04 -0.25  0.8032      0.06      0.06 0.7978
3: Age on Control  -0.07 40.45 -0.66  0.5146      0.12      0.43 0.5356
4:      Age on SR  -0.02 44.40 -0.28  0.7831      0.04      0.08 0.8100
5:      YSR vs OC   0.00 35.64  0.03  0.9732      0.05      0.00 0.9756
   EffSize.Boot
1:         0.13
2:         0.04
3:         0.10
4:         0.05
5:         0.04


$DetallSimple[[2]]
$DetallSimple[[2]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 0.25 0.618   0.25  0.618  0.05 0.8190 0.5843        0.604       
2:     Sleep 0.12 0.734   0.12  0.734  0.20 0.6554 0.7529        0.730       
3: Age*Sleep 0.02 0.895   0.02  0.850  0.00 0.9488 0.9583        0.882       
   EffSize
1:    0.06
2:    0.03
3:    0.04

$DetallSimple[[2]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.02 63.84  0.15  0.8788      0.03      0.02 0.9000
2:   Sleep on Old   0.04 37.10  0.32  0.7471      0.06      0.11 0.7378
3: Age on Control  -0.05 45.61 -0.40  0.6876      0.06      0.16 0.6944
4:      Age on SR  -0.03 52.80 -0.30  0.7676      0.05      0.09 0.7478
   EffSize.Boot
1:         0.03
2:         0.06
3:         0.07
4:         0.06

$DetallSimple[[2]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.02 63.84  0.15  0.8788      0.03      0.02 0.8833
2:   Sleep on Old   0.04 37.10  0.32  0.7471      0.05      0.11 0.7544
3: Age on Control  -0.05 45.61 -0.40  0.6876      0.07      0.16 0.6889
4:      Age on SR  -0.03 52.80 -0.30  0.7676      0.07      0.09 0.7678
5:      YSR vs OC  -0.07 42.53 -0.55  0.5874      0.10      0.30 0.5767
   EffSize.Boot
1:         0.03
2:         0.06
3:         0.07
4:         0.06
5:         0.08


$DetallSimple[[3]]
$DetallSimple[[3]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 0.53 0.470   0.53  0.470  0.39 0.5319 0.4658        0.468       
2:     Sleep 0.42 0.519   0.42  0.519  0.62 0.4330 0.5442        0.524       
3: Age*Sleep 1.37 0.245   0.09  0.310  1.10 0.2948 0.2487        0.247       
   EffSize
1:    0.08
2:    0.04
3:    0.16

$DetallSimple[[3]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.04 61.52 -0.36  0.7193      0.06      0.13 0.7144
2:   Sleep on Old   0.13 44.35  1.32  0.1942      0.20      1.74 0.1789
3: Age on Control  -0.14 51.58 -1.36  0.1792      0.21      1.85 0.1733
4:      Age on SR   0.03 52.94  0.31  0.7579      0.05      0.10 0.7711
   EffSize.Boot
1:         0.06
2:         0.21
3:         0.21
4:         0.05

$DetallSimple[[3]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.04 61.52 -0.36  0.7193      0.06      0.13 0.7300
2:   Sleep on Old   0.13 44.35  1.32  0.1942      0.22      1.74 0.1789
3: Age on Control  -0.14 51.58 -1.36  0.1792      0.20      1.85 0.2056
4:      Age on SR   0.03 52.94  0.31  0.7579      0.06      0.10 0.7456
5:      YSR vs OC  -0.10 49.61 -0.93  0.3549      0.15      0.87 0.3522
   EffSize.Boot
1:         0.05
2:         0.21
3:         0.21
4:         0.06
5:         0.14


$DetallSimple[[4]]
$DetallSimple[[4]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 1.56 0.216   1.56  0.216  1.50 0.2225 0.1987        0.221       
2:     Sleep 0.36 0.552   0.36  0.552  0.70 0.4026 0.5860        0.525       
3: Age*Sleep 1.10 0.296   0.09  0.330  0.94 0.3343 0.3489        0.282       
   EffSize
1:    0.13
2:    0.04
3:    0.16

$DetallSimple[[4]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.03 61.43 -0.33  0.7437      0.06      0.11 0.7633
2:   Sleep on Old   0.11 41.58  1.14  0.2613      0.19      1.30 0.2578
3: Age on Control  -0.15 45.95 -1.58  0.1218      0.24      2.48 0.1244
4:      Age on SR  -0.01 52.94 -0.14  0.8866      0.04      0.02 0.8889
   EffSize.Boot
1:         0.05
2:         0.19
3:         0.24
4:         0.04

$DetallSimple[[4]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.03 61.43 -0.33  0.7437      0.06      0.11 0.7689
2:   Sleep on Old   0.11 41.58  1.14  0.2613      0.19      1.30 0.2589
3: Age on Control  -0.15 45.95 -1.58  0.1218      0.25      2.48 0.1311
4:      Age on SR  -0.01 52.94 -0.14  0.8866      0.05      0.02 0.8811
5:      YSR vs OC  -0.12 46.87 -1.21  0.2333      0.21      1.46 0.2433
   EffSize.Boot
1:         0.05
2:         0.19
3:         0.23
4:         0.04
5:         0.19


$DetallSimple[[5]]
$DetallSimple[[5]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 0.11 0.746   0.11  0.746  0.77 0.3814 0.7496        0.744       
2:     Sleep 0.10 0.759   0.10  0.759  0.12 0.7285 0.7546        0.761       
3: Age*Sleep 0.03 0.856  -0.04  0.680  0.17 0.6835 0.9316        0.865       
   EffSize
1:    0.06
2:    0.03
3:    0.08

$DetallSimple[[5]]$Detall
            Contr psihat    df test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.03 61.21 0.38  0.7053      0.06      0.14 0.6944
2:   Sleep on Old   0.01 43.45 0.08  0.9346      0.03      0.01 0.9478
3: Age on Control   0.03 50.16 0.40  0.6896      0.09      0.16 0.6744
4:      Age on SR   0.01 48.24 0.09  0.9268      0.04      0.01 0.9289
   EffSize.Boot
1:         0.05
2:         0.04
3:         0.07
4:         0.03

$DetallSimple[[5]]$DetallExt
            Contr psihat    df test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.03 61.21 0.38  0.7053      0.05      0.14 0.7156
2:   Sleep on Old   0.01 43.45 0.08  0.9346      0.04      0.01 0.9156
3: Age on Control   0.03 50.16 0.40  0.6896      0.08      0.16 0.6878
4:      Age on SR   0.01 48.24 0.09  0.9268      0.03      0.01 0.9244
5:      YSR vs OC   0.00 49.26 0.01  0.9898      0.05      0.00 0.9967
   EffSize.Boot
1:         0.05
2:         0.04
3:         0.09
4:         0.04
5:         0.05
Omnibus AOV. Design 2x2x(5xS)
Names Q p pBoot Sig pBootMas Sig2
Age 0.48 0.4886 0.4708 0.4842
Sleep 0.09 0.7658 0.7696 0.7631
Time 1.14 0.3383 0.0167
0.0345
Age*Sleep 0.37 0.5457 0.5259 0.4801
Age*Time 0.25 0.9113 0.5960 0.6670
Sleep*Time 0.26 0.9032 0.5643 0.6440
AgeSleepTime 0.31 0.8731 0.4925 0.5672
Interaction Age-Sleep. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1
Sleep on Young -0.09 287.49 -0.42 0.6731 0.06
Sleep on Old 0.26 198.13 1.12 0.2639 0.04
Age on Control -0.38 208.58 -1.64 0.1019 0.17
Age on SR -0.03 248.53 -0.12 0.9053 0.07
Interaction Age-Time. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1
Age on M1 -0.09 81.88 -0.68 0.4994 0.08
Age on M2 -0.08 90.03 -0.50 0.6171 0.05
Age on M3 -0.11 104.49 -0.73 0.4695 0.07
Age on M4 -0.17 97.14 -1.25 0.2153 0.14
Age on M5 0.04 93.95 0.33 0.7453 0.06
M1-M2 on Young -0.10 NA -1.12 0.2761 0.11
M1-M2 on Old -0.06 NA -0.66 0.5151 0.09
M2-M3 on Young -0.06 NA -1.04 0.3112 0.02
M2-M3 on Old -0.07 NA -0.98 0.3363 0.05
M3-M4 on Young 0.11 NA 1.66 0.1125 0.09
M3-M4 on Old 0.07 NA 1.20 0.2427 0.07
M4-M5 on Young -0.02 NA -0.26 0.7992 0.00
M4-M5 on Old 0.29 NA 2.83 0.0100 0.20
Interaction Sleep-Time. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1
Sleep on M1 -0.10 81.88 -0.73 0.4690 0.09
Sleep on M2 0.06 90.03 0.34 0.7331 0.02
Sleep on M3 0.10 104.49 0.65 0.5187 0.04
Sleep on M4 0.08 97.14 0.60 0.5513 0.04
Sleep on M5 0.04 93.95 0.31 0.7583 0.04
M1-M2 on Young -0.22 NA -3.50 0.0021 0.16
M1-M2 on Old -0.01 NA -0.09 0.9285 0.04
M2-M3 on Young -0.03 NA -0.31 0.7607 0.03
M2-M3 on Old -0.10 NA -1.99 0.0594 0.02
M3-M4 on Young 0.11 NA 1.39 0.1779 0.08
M3-M4 on Old 0.12 NA 2.12 0.0459 0.08
M4-M5 on Young 0.22 NA 2.65 0.0149 0.09
M4-M5 on Old 0.15 NA 2.06 0.0518 0.08
Main Effect Time. Design 2x2x(5xS)
Contr psihat test p.value Psihat2 p.value2 EfSize.V1
M1-M2 -0.19 -1.73 0.0989 -0.27 0.020 0.10
M2-M3 -0.21 -2.02 0.0566 -0.09 0.384 0.04
M3-M4 0.17 1.32 0.2006 0.20 0.056 0.08
M4-M5 0.34 3.16 0.0048 0.23 0.064 0.09
Simple Effect Time each Age-Sleep condition. Design 2x2x(5xS)
Contr psihat df test p.value Psihat2 p.value2 dif.yuen df.yuen test.yuen EffSize.yuen pvaluet.yuen
M1-M2 on Y_C -0.08 NA -1.24 0.2282 -0.11 0.040 -0.11 35 -1.93 0.17 0.0619
M1-M2 on Y_SR -0.01 NA -0.23 0.8238 -0.03 0.688 -0.03 29 -0.46 0.04 0.6523
M1-M2 on O_C -0.14 NA -2.96 0.0075 -0.10 0.140 -0.10 21 -1.40 0.14 0.1765
M1-M2 on O_SR 0.04 NA 0.54 0.5967 -0.03 0.700 -0.03 24 -0.50 0.05 0.6186
M2-M3 on Y_C 0.02 NA 0.29 0.7733 0.01 0.852 0.01 35 0.23 0.01 0.8231
M2-M3 on Y_SR -0.05 NA -1.68 0.1083 -0.04 0.348 -0.04 29 -0.94 0.06 0.3542
M2-M3 on O_C -0.06 NA -0.93 0.3635 -0.07 0.316 -0.07 21 -1.09 0.10 0.2874
M2-M3 on O_SR -0.04 NA -0.92 0.3679 0.02 0.792 0.02 24 0.41 0.03 0.6885
M3-M4 on Y_C 0.04 NA 0.92 0.3686 0.06 0.124 0.06 35 1.39 0.09 0.1748
M3-M4 on Y_SR 0.05 NA 1.93 0.0676 0.07 0.012 0.07 29 2.10 0.10 0.0443
M3-M4 on O_C 0.08 NA 1.78 0.0889 0.05 0.488 0.05 21 0.65 0.08 0.5232
M3-M4 on O_SR 0.03 NA 0.83 0.4176 0.02 0.664 0.02 24 0.41 0.04 0.6857
M4-M5 on Y_C 0.01 NA 0.22 0.8258 -0.03 0.628 -0.03 35 -0.47 0.04 0.6408
M4-M5 on Y_SR 0.01 NA 0.29 0.7709 0.04 0.392 0.04 29 0.94 0.06 0.3558
M4-M5 on O_C 0.19 NA 3.68 0.0014 0.16 0.012 0.16 21 2.28 0.30 0.0329
M4-M5 on O_SR 0.11 NA 1.64 0.1150 0.06 0.396 0.06 24 0.73 0.10 0.4731
Simple Effect Age-Sleep on Time=1 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.46 0.500 0.46 0.500 0.20 0.6559 0.4891 0.504 0.08
Sleep 0.53 0.469 0.53 0.469 0.58 0.4490 0.4841 0.471 0.10
Age*Sleep 0.10 0.753 0.04 0.630 0.14 0.7111 0.8364 0.738 0.04
Simple Effect Age-Sleep on Time=1 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.07 63.87 -0.91 0.3644 0.13 0.83 0.3744 0.14
Sleep on Old -0.03 43.04 -0.25 0.8032 0.05 0.06 0.8200 0.05
Age on Control -0.07 40.45 -0.66 0.5146 0.12 0.43 0.5233 0.10
Age on SR -0.02 44.40 -0.28 0.7831 0.05 0.08 0.7756 0.05
Simple Effect Age-Sleep on Time=1 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.07 63.87 -0.91 0.3644 0.11 0.83 0.3633 0.13
Sleep on Old -0.03 43.04 -0.25 0.8032 0.06 0.06 0.7978 0.04
Age on Control -0.07 40.45 -0.66 0.5146 0.12 0.43 0.5356 0.10
Age on SR -0.02 44.40 -0.28 0.7831 0.04 0.08 0.8100 0.05
YSR vs OC 0.00 35.64 0.03 0.9732 0.05 0.00 0.9756 0.04
Simple Effect Age-Sleep on Time=2 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.25 0.618 0.25 0.618 0.05 0.8190 0.5843 0.604 0.06
Sleep 0.12 0.734 0.12 0.734 0.20 0.6554 0.7529 0.730 0.03
Age*Sleep 0.02 0.895 0.02 0.850 0.00 0.9488 0.9583 0.882 0.04
Simple Effect Age-Sleep on Time=2 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.02 63.84 0.15 0.8788 0.03 0.02 0.9000 0.03
Sleep on Old 0.04 37.10 0.32 0.7471 0.06 0.11 0.7378 0.06
Age on Control -0.05 45.61 -0.40 0.6876 0.06 0.16 0.6944 0.07
Age on SR -0.03 52.80 -0.30 0.7676 0.05 0.09 0.7478 0.06
Simple Effect Age-Sleep on Time=2 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.02 63.84 0.15 0.8788 0.03 0.02 0.8833 0.03
Sleep on Old 0.04 37.10 0.32 0.7471 0.05 0.11 0.7544 0.06
Age on Control -0.05 45.61 -0.40 0.6876 0.07 0.16 0.6889 0.07
Age on SR -0.03 52.80 -0.30 0.7676 0.07 0.09 0.7678 0.06
YSR vs OC -0.07 42.53 -0.55 0.5874 0.10 0.30 0.5767 0.08
Simple Effect Age-Sleep on Time=3 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.53 0.470 0.53 0.470 0.39 0.5319 0.4658 0.468 0.08
Sleep 0.42 0.519 0.42 0.519 0.62 0.4330 0.5442 0.524 0.04
Age*Sleep 1.37 0.245 0.09 0.310 1.10 0.2948 0.2487 0.247 0.16
Simple Effect Age-Sleep on Time=3 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.04 61.52 -0.36 0.7193 0.06 0.13 0.7144 0.06
Sleep on Old 0.13 44.35 1.32 0.1942 0.20 1.74 0.1789 0.21
Age on Control -0.14 51.58 -1.36 0.1792 0.21 1.85 0.1733 0.21
Age on SR 0.03 52.94 0.31 0.7579 0.05 0.10 0.7711 0.05
Simple Effect Age-Sleep on Time=3 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.04 61.52 -0.36 0.7193 0.06 0.13 0.7300 0.05
Sleep on Old 0.13 44.35 1.32 0.1942 0.22 1.74 0.1789 0.21
Age on Control -0.14 51.58 -1.36 0.1792 0.20 1.85 0.2056 0.21
Age on SR 0.03 52.94 0.31 0.7579 0.06 0.10 0.7456 0.06
YSR vs OC -0.10 49.61 -0.93 0.3549 0.15 0.87 0.3522 0.14
Simple Effect Age-Sleep on Time=4 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 1.56 0.216 1.56 0.216 1.50 0.2225 0.1987 0.221 0.13
Sleep 0.36 0.552 0.36 0.552 0.70 0.4026 0.5860 0.525 0.04
Age*Sleep 1.10 0.296 0.09 0.330 0.94 0.3343 0.3489 0.282 0.16
Simple Effect Age-Sleep on Time=4 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.03 61.43 -0.33 0.7437 0.06 0.11 0.7633 0.05
Sleep on Old 0.11 41.58 1.14 0.2613 0.19 1.30 0.2578 0.19
Age on Control -0.15 45.95 -1.58 0.1218 0.24 2.48 0.1244 0.24
Age on SR -0.01 52.94 -0.14 0.8866 0.04 0.02 0.8889 0.04
Simple Effect Age-Sleep on Time=4 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.03 61.43 -0.33 0.7437 0.06 0.11 0.7689 0.05
Sleep on Old 0.11 41.58 1.14 0.2613 0.19 1.30 0.2589 0.19
Age on Control -0.15 45.95 -1.58 0.1218 0.25 2.48 0.1311 0.23
Age on SR -0.01 52.94 -0.14 0.8866 0.05 0.02 0.8811 0.04
YSR vs OC -0.12 46.87 -1.21 0.2333 0.21 1.46 0.2433 0.19
Simple Effect Age-Sleep on Time=5 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.11 0.746 0.11 0.746 0.77 0.3814 0.7496 0.744 0.06
Sleep 0.10 0.759 0.10 0.759 0.12 0.7285 0.7546 0.761 0.03
Age*Sleep 0.03 0.856 -0.04 0.680 0.17 0.6835 0.9316 0.865 0.08
Simple Effect Age-Sleep on Time=5 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.03 61.21 0.38 0.7053 0.06 0.14 0.6944 0.05
Sleep on Old 0.01 43.45 0.08 0.9346 0.03 0.01 0.9478 0.04
Age on Control 0.03 50.16 0.40 0.6896 0.09 0.16 0.6744 0.07
Age on SR 0.01 48.24 0.09 0.9268 0.04 0.01 0.9289 0.03
Simple Effect Age-Sleep on Time=5 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.03 61.21 0.38 0.7053 0.05 0.14 0.7156 0.05
Sleep on Old 0.01 43.45 0.08 0.9346 0.04 0.01 0.9156 0.04
Age on Control 0.03 50.16 0.40 0.6896 0.08 0.16 0.6878 0.09
Age on SR 0.01 48.24 0.09 0.9268 0.03 0.01 0.9244 0.04
YSR vs OC 0.00 49.26 0.01 0.9898 0.05 0.00 0.9967 0.05

10.2 Fig S1C Peak firing rate {Design 2x2x(5xS)}

  NmBas="FigS1C PeakFiringRate"
  NmFAlL<-paste0(PathDesign,NmBas)
  if (!dir.exists(NmFAlL)) {dir.create(NmFAlL)}
  NmFAlL<-paste0(NmFAlL,"/")
  ResGen<-NA
  
  rrt<-ExDataIS.2(nmF = paste0(PathDesign,"Parameters.csv"),Vars = c(1,5,6,12:16),vIntP =c(4:8),lvlCh = list("HAB"="pfr_s1", "T1"="pfr_s2","T2"="pfr_s3","T3"="pfr_s4","Test"="pfr_s5"))
  DatDT<-rrt$DT
  ArP<-rrt$Arp
  ExtendDT<-rrt$ExtendDT
  
  # Simple Effects:
  DatEfS<-list()
  for(is in 1:5) {
    DatEfS[[is]]<-ExData.2(nmF = paste0(PathDesign,"Parameters.csv"),Vars = c(5:6,(6+is)))
    names(DatEfS[[is]]$DT)[3]<-"DepV"
  }
  
  #Graphs
  Grp<- Grph.3(DatP = ExtendDT,"OPR",LblsP =c("Object Exploration", "","Peak FR (Hz)"),ylmP =c(0,10),hLin = F,lvIp=5)
 
  levBp<-seq(0.7, 6, by=0.2)
  Grp2<- Grp + 
    geom_signif(annotation=c("","","*"),
              y_position=c(7.5,7.5,8),
              xmin=c(levBp[1],levBp[1+5], mean(levBp[c(1,4)])),
              xmax=c(levBp[4],levBp[4+5], mean(levBp[c(1+5,4+5)])), 
              tip_length = c(0.02, 0.02),textsize=6)+
    geom_signif(annotation=c("","","*"),
              y_position=c(7.5,7.5,8),
              xmin=c(levBp[1+15],levBp[1+20], mean(levBp[c(1+15,4+15)])),
              xmax=c(levBp[4+15],levBp[4+20], mean(levBp[c(1+20,4+20)])), 
              tip_length = c(0.02, 0.02),textsize=6)
  
    #AOV
    names(rrt$DT)[4:8]<-c("T1","T2","T3","T4","T5")
    ResGen<-AOVMx2.5(A=2,B=2,C=5,DatPas = rrt,DatEfSp = DatEfS,nBMM1 = 1000,nBMM2 = 1000,Prc = 2)
    AlmacenGen2(GrpP = Grp,Grp2P = Grp2,DataPas = ResGen,PathDesignP = PathDesign,NmBasP = NmBas,Typ=2)
  
  # Other Graphs
    GrpO<-Grph.3.Otros(ExtendDT,LblsP =c("Object Exploration", "C","Peak FR (Hz)"))
    
    ExtendDTCol<-copy(ExtendDT)
    ExtendDTCol$Moment<-"All"
    ExtendDTCol<-data.table(rbind(ExtendDT,ExtendDTCol))
    
    Grp3<-Grph.3(DatP = ExtendDTCol,"OPR",LblsP =c("Object Exploration", "C","Peak FR (Hz)"),ylmP =c(0,1.5),hLin = F,lvIp = 6,wMain = T)
   
    
    pdf(paste0(NmFAlL,NmBas,"OtrosGraphs.pdf"))
      Grp3
      GrpO
    dev.off()
    
    # Results
        # Results
        plot(Grp)
        plot(Grp2) # Only this graph is printed in the html file.
        GrpO
        plot(Grp3)
        ResGen # Lean option to view the results of statistical analysis
        
        Kbl3(ResPas = ResGen[[1]], lbl = "Omnibus AOV. Design 2x2x(5xS)");cat("\n")
        Kbl3(ResGen[[2]], "Interaction Age-Sleep. Design 2x2x(5xS)")
        Kbl3(ResGen[[3]], "Interaction Age-Time. Design 2x2x(5xS)")
        Kbl3(ResGen[[4]], "Interaction Sleep-Time. Design 2x2x(5xS)")
        Kbl3(ResGen[[5]], "Main Effect Time. Design 2x2x(5xS)")
        Kbl3(ResGen[[6]], "Simple Effect Time each Age-Sleep condition. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[1]][[1]], "Simple Effect Age-Sleep on Time=1 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[1]][[2]], "Simple Effect Age-Sleep on Time=1 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[1]][[3]], "Simple Effect Age-Sleep on Time=1 Extense Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[2]][[1]], "Simple Effect Age-Sleep on Time=2 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[2]][[2]], "Simple Effect Age-Sleep on Time=2 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[2]][[3]], "Simple Effect Age-Sleep on Time=2 Extense Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[3]][[1]], "Simple Effect Age-Sleep on Time=3 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[3]][[2]], "Simple Effect Age-Sleep on Time=3 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[3]][[3]], "Simple Effect Age-Sleep on Time=3 Extense Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[4]][[1]], "Simple Effect Age-Sleep on Time=4 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[4]][[2]], "Simple Effect Age-Sleep on Time=4 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[4]][[3]], "Simple Effect Age-Sleep on Time=4 Extense Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[5]][[1]], "Simple Effect Age-Sleep on Time=5 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[5]][[2]], "Simple Effect Age-Sleep on Time=5 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[5]][[3]], "Simple Effect Age-Sleep on Time=5 Extense Simple Effects. Design 2x2x(5xS)")
           Eff   p.V1 p.Sig
1:   p.value.A 0.1235      
2:   p.value.B 0.7930      
3:   p.value.C 0.0234 *    
4:  p.value.AB 0.8514      
5:  p.value.AC 0.1436      
6:  p.value.BC 0.1185      
7: p.value.ABC 0.2437      
           Eff   p.V1 p.Sig
1:   p.value.A 0.1070      
2:   p.value.B 0.7568      
3:   p.value.C 0.0378 *    
4:  p.value.AB 0.9820      
5:  p.value.AC 0.2077      
6:  p.value.BC 0.1822      
7: p.value.ABC 0.3415      
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
$BP

$Bars

$MargAB

$MargAC

$MargBC

$MargC

quartz_off_screen 
                2 
$BP

$Bars

$MargAB

$MargAC

$MargBC

$MargC

$AOV
            Names    Q      p  pBoot   Sig pBootMas  Sig2
1:            Age 2.54 0.1112 0.1235         0.1070      
2:          Sleep 0.09 0.7590 0.7930         0.7568      
3:           Time 1.11 0.3514 0.0234 *       0.0378 *    
4:      Age*Sleep 0.04 0.8442 0.8514         0.9820      
5:       Age*Time 0.62 0.6448 0.1436         0.2077      
6:     Sleep*Time 0.66 0.6174 0.1185         0.1822      
7: Age*Sleep*Time 0.48 0.7489 0.2437         0.3415      

$InterAB
            Contr psihat     df  test p.value EfSize.V1
1: Sleep on Young   0.46 283.51  0.68  0.4949      0.06
2:   Sleep on Old   0.10 201.48  0.12  0.9081      0.07
3: Age on Control  -1.28 225.02 -1.53  0.1272      0.07
4:      Age on SR  -1.63 185.54 -2.27  0.0242      0.23

$InterAC
             Contr psihat    df  test p.value EfSize.V1
 1:      Age on M1  -0.12 90.39 -0.29  0.7696      0.04
 2:      Age on M2  -0.31 77.72 -0.62  0.5347      0.04
 3:      Age on M3  -0.96 85.61 -1.90  0.0606      0.22
 4:      Age on M4  -1.28 83.48 -2.54  0.0129      0.26
 5:      Age on M5  -0.23 84.24 -0.44  0.6598      0.04
 6: M1-M2 on Young  -0.60    NA -1.96  0.0635      0.08
 7:   M1-M2 on Old  -0.37    NA -1.16  0.2596      0.10
 8: M2-M3 on Young  -0.16    NA -0.66  0.5188      0.01
 9:   M2-M3 on Old  -0.77    NA -2.72  0.0129      0.17
10: M3-M4 on Young   0.41    NA  1.18  0.2528      0.06
11:   M3-M4 on Old   0.22    NA  0.69  0.4958      0.01
12: M4-M5 on Young  -0.80    NA -1.98  0.0611      0.02
13:   M4-M5 on Old   0.50    NA  1.29  0.2117      0.23

$InterBC
             Contr psihat    df  test p.value EfSize.V1
 1:    Sleep on M1  -0.38 90.39 -0.91  0.3659      0.09
 2:    Sleep on M2   0.58 77.72  1.15  0.2536      0.11
 3:    Sleep on M3   0.11 85.61  0.22  0.8272      0.01
 4:    Sleep on M4   0.54 83.48  1.07  0.2890      0.10
 5:    Sleep on M5  -0.29 84.24 -0.55  0.5860      0.04
 6: M1-M2 on Young  -0.76    NA -3.07  0.0058      0.19
 7:   M1-M2 on Old   0.10    NA  0.30  0.7696      0.01
 8: M2-M3 on Young  -0.37    NA -1.09  0.2895      0.00
 9:   M2-M3 on Old  -0.51    NA -1.71  0.1013      0.14
10: M3-M4 on Young   0.21    NA  0.61  0.5480      0.02
11:   M3-M4 on Old   0.29    NA  0.83  0.4134      0.10
12: M4-M5 on Young   0.10    NA  0.21  0.8375      0.17
13:   M4-M5 on Old  -0.07    NA -0.12  0.9069      0.03

$DetallMainC
   Contr psihat  test p.value Psihat2 p.value2 EfSize.V1
1: M1-M2  -0.89 -2.08  0.0503   -0.87    0.012      0.09
2: M2-M3  -0.94 -2.36  0.0278   -0.63    0.168      0.06
3: M3-M4   0.53  0.90  0.3800    0.20    0.552      0.03
4: M4-M5  -0.58 -0.96  0.3461    1.16    0.064      0.11

$DetallTrialCadaCondAB
            Contr psihat df  test p.value Psihat2 p.value2 dif.yuen df.yuen
 1:  M1-M2 on Y_C  -0.35 NA -1.95  0.0642   -0.25    0.172    -0.25      35
 2: M1-M2 on Y_SR  -0.04 NA -0.20  0.8407   -0.09    0.612    -0.09      29
 3:  M1-M2 on O_C  -0.46 NA -3.96  0.0007   -0.67    0.000    -0.67      21
 4: M1-M2 on O_SR   0.18 NA  0.82  0.4231    0.14    0.548     0.14      24
 5:  M2-M3 on Y_C   0.11 NA  0.55  0.5884    0.14    0.532     0.14      35
 6: M2-M3 on Y_SR  -0.13 NA -0.79  0.4402   -0.13    0.492    -0.13      29
 7:  M2-M3 on O_C  -0.35 NA -1.42  0.1691   -0.22    0.360    -0.22      21
 8: M2-M3 on O_SR  -0.47 NA -3.34  0.0031   -0.42    0.060    -0.42      24
 9:  M3-M4 on Y_C   0.07 NA  0.36  0.7206   -0.02    0.880    -0.02      35
10: M3-M4 on Y_SR   0.35 NA  2.65  0.0150    0.28    0.096     0.28      29
11:  M3-M4 on O_C   0.26 NA  1.20  0.2419   -0.09    0.800    -0.09      21
12: M3-M4 on O_SR   0.08 NA  0.33  0.7468    0.03    0.768     0.03      24
13:  M4-M5 on Y_C  -0.60 NA -1.43  0.1672   -0.02    0.996    -0.02      35
14: M4-M5 on Y_SR   0.08 NA  0.62  0.5448    0.07    0.712     0.07      29
15:  M4-M5 on O_C   0.79 NA  3.43  0.0025    1.01    0.000     1.01      21
16: M4-M5 on O_SR   0.04 NA  0.09  0.9291    0.10    0.864     0.10      24
    test.yuen EffSize.yuen pvaluet.yuen
 1:     -1.28         0.12       0.2106
 2:     -0.50         0.05       0.6210
 3:     -2.53         0.27       0.0195
 4:      0.66         0.09       0.5135
 5:      0.65         0.06       0.5230
 6:     -0.78         0.07       0.4393
 7:     -0.81         0.09       0.4292
 8:     -1.57         0.25       0.1306
 9:     -0.12         0.01       0.9077
10:      2.01         0.17       0.0538
11:     -0.36         0.04       0.7203
12:      0.11         0.01       0.9123
13:     -0.05         0.01       0.9590
14:      0.55         0.05       0.5838
15:      4.05         0.43       0.0006
16:      0.23         0.04       0.8180

$DetallSimple
$DetallSimple[[1]]
$DetallSimple[[1]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 0.46 0.500   0.46  0.500  0.20 0.6559 0.4891        0.488       
2:     Sleep 0.53 0.469   0.53  0.469  0.58 0.4490 0.4841        0.462       
3: Age*Sleep 0.10 0.753   0.04  0.630  0.14 0.7111 0.8364        0.757       
   EffSize
1:    0.08
2:    0.10
3:    0.04

$DetallSimple[[1]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.07 63.87 -0.91  0.3644      0.13      0.83 0.3500
2:   Sleep on Old  -0.03 43.04 -0.25  0.8032      0.04      0.06 0.7989
3: Age on Control  -0.07 40.45 -0.66  0.5146      0.10      0.43 0.5111
4:      Age on SR  -0.02 44.40 -0.28  0.7831      0.04      0.08 0.7689
   EffSize.Boot
1:         0.12
2:         0.03
3:         0.10
4:         0.04

$DetallSimple[[1]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.07 63.87 -0.91  0.3644      0.12      0.83 0.3600
2:   Sleep on Old  -0.03 43.04 -0.25  0.8032      0.05      0.06 0.8144
3: Age on Control  -0.07 40.45 -0.66  0.5146      0.13      0.43 0.5156
4:      Age on SR  -0.02 44.40 -0.28  0.7831      0.04      0.08 0.7911
5:      YSR vs OC   0.00 35.64  0.03  0.9732      0.05      0.00 0.9756
   EffSize.Boot
1:         0.12
2:         0.05
3:         0.12
4:         0.05
5:         0.04


$DetallSimple[[2]]
$DetallSimple[[2]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 0.25 0.618   0.25  0.618  0.05 0.8190 0.5843        0.633       
2:     Sleep 0.12 0.734   0.12  0.734  0.20 0.6554 0.7529        0.730       
3: Age*Sleep 0.02 0.895   0.02  0.850  0.00 0.9488 0.9583        0.891       
   EffSize
1:    0.06
2:    0.03
3:    0.04

$DetallSimple[[2]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.02 63.84  0.15  0.8788      0.03      0.02 0.8956
2:   Sleep on Old   0.04 37.10  0.32  0.7471      0.06      0.11 0.7478
3: Age on Control  -0.05 45.61 -0.40  0.6876      0.07      0.16 0.7000
4:      Age on SR  -0.03 52.80 -0.30  0.7676      0.05      0.09 0.7844
   EffSize.Boot
1:         0.03
2:         0.05
3:         0.06
4:         0.05

$DetallSimple[[2]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.02 63.84  0.15  0.8788      0.03      0.02 0.8733
2:   Sleep on Old   0.04 37.10  0.32  0.7471      0.06      0.11 0.7567
3: Age on Control  -0.05 45.61 -0.40  0.6876      0.08      0.16 0.6633
4:      Age on SR  -0.03 52.80 -0.30  0.7676      0.05      0.09 0.7856
5:      YSR vs OC  -0.07 42.53 -0.55  0.5874      0.10      0.30 0.5767
   EffSize.Boot
1:         0.03
2:         0.06
3:         0.09
4:         0.05
5:         0.08


$DetallSimple[[3]]
$DetallSimple[[3]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 0.53 0.470   0.53  0.470  0.39 0.5319 0.4658        0.473       
2:     Sleep 0.42 0.519   0.42  0.519  0.62 0.4330 0.5442        0.512       
3: Age*Sleep 1.37 0.245   0.09  0.310  1.10 0.2948 0.2487        0.251       
   EffSize
1:    0.08
2:    0.04
3:    0.16

$DetallSimple[[3]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.04 61.52 -0.36  0.7193      0.08      0.13 0.7200
2:   Sleep on Old   0.13 44.35  1.32  0.1942      0.20      1.74 0.1767
3: Age on Control  -0.14 51.58 -1.36  0.1792      0.22      1.85 0.1933
4:      Age on SR   0.03 52.94  0.31  0.7579      0.06      0.10 0.7567
   EffSize.Boot
1:         0.06
2:         0.21
3:         0.23
4:         0.06

$DetallSimple[[3]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.04 61.52 -0.36  0.7193      0.06      0.13 0.7356
2:   Sleep on Old   0.13 44.35  1.32  0.1942      0.21      1.74 0.2122
3: Age on Control  -0.14 51.58 -1.36  0.1792      0.24      1.85 0.1889
4:      Age on SR   0.03 52.94  0.31  0.7579      0.04      0.10 0.7300
5:      YSR vs OC  -0.10 49.61 -0.93  0.3549      0.15      0.87 0.3522
   EffSize.Boot
1:         0.07
2:         0.20
3:         0.22
4:         0.06
5:         0.14


$DetallSimple[[4]]
$DetallSimple[[4]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 1.56 0.216   1.56  0.216  1.50 0.2225 0.1987        0.218       
2:     Sleep 0.36 0.552   0.36  0.552  0.70 0.4026 0.5860        0.544       
3: Age*Sleep 1.10 0.296   0.09  0.330  0.94 0.3343 0.3489        0.297       
   EffSize
1:    0.13
2:    0.04
3:    0.16

$DetallSimple[[4]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.03 61.43 -0.33  0.7437      0.05      0.11 0.7544
2:   Sleep on Old   0.11 41.58  1.14  0.2613      0.18      1.30 0.2633
3: Age on Control  -0.15 45.95 -1.58  0.1218      0.24      2.48 0.1256
4:      Age on SR  -0.01 52.94 -0.14  0.8866      0.04      0.02 0.9011
   EffSize.Boot
1:         0.06
2:         0.20
3:         0.26
4:         0.04

$DetallSimple[[4]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.03 61.43 -0.33  0.7437      0.04      0.11 0.7389
2:   Sleep on Old   0.11 41.58  1.14  0.2613      0.19      1.30 0.2478
3: Age on Control  -0.15 45.95 -1.58  0.1218      0.24      2.48 0.1011
4:      Age on SR  -0.01 52.94 -0.14  0.8866      0.04      0.02 0.8956
5:      YSR vs OC  -0.12 46.87 -1.21  0.2333      0.21      1.46 0.2433
   EffSize.Boot
1:         0.05
2:         0.20
3:         0.25
4:         0.04
5:         0.19


$DetallSimple[[5]]
$DetallSimple[[5]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 0.11 0.746   0.11  0.746  0.77 0.3814 0.7496        0.740       
2:     Sleep 0.10 0.759   0.10  0.759  0.12 0.7285 0.7546        0.764       
3: Age*Sleep 0.03 0.856  -0.04  0.680  0.17 0.6835 0.9316        0.864       
   EffSize
1:    0.06
2:    0.03
3:    0.08

$DetallSimple[[5]]$Detall
            Contr psihat    df test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.03 61.21 0.38  0.7053      0.05      0.14 0.7089
2:   Sleep on Old   0.01 43.45 0.08  0.9346      0.03      0.01 0.9256
3: Age on Control   0.03 50.16 0.40  0.6896      0.07      0.16 0.7156
4:      Age on SR   0.01 48.24 0.09  0.9268      0.04      0.01 0.9433
   EffSize.Boot
1:         0.05
2:         0.03
3:         0.08
4:         0.04

$DetallSimple[[5]]$DetallExt
            Contr psihat    df test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.03 61.21 0.38  0.7053      0.04      0.14 0.7100
2:   Sleep on Old   0.01 43.45 0.08  0.9346      0.04      0.01 0.9311
3: Age on Control   0.03 50.16 0.40  0.6896      0.07      0.16 0.6900
4:      Age on SR   0.01 48.24 0.09  0.9268      0.03      0.01 0.9344
5:      YSR vs OC   0.00 49.26 0.01  0.9898      0.05      0.00 0.9967
   EffSize.Boot
1:         0.06
2:         0.03
3:         0.08
4:         0.04
5:         0.05
Omnibus AOV. Design 2x2x(5xS)
Names Q p pBoot Sig pBootMas Sig2
Age 2.54 0.1112 0.1235 0.1070
Sleep 0.09 0.7590 0.7930 0.7568
Time 1.11 0.3514 0.0234
0.0378
Age*Sleep 0.04 0.8442 0.8514 0.9820
Age*Time 0.62 0.6448 0.1436 0.2077
Sleep*Time 0.66 0.6174 0.1185 0.1822
AgeSleepTime 0.48 0.7489 0.2437 0.3415
Interaction Age-Sleep. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1
Sleep on Young 0.46 283.51 0.68 0.4949 0.06
Sleep on Old 0.10 201.48 0.12 0.9081 0.07
Age on Control -1.28 225.02 -1.53 0.1272 0.07
Age on SR -1.63 185.54 -2.27 0.0242 0.23
Interaction Age-Time. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1
Age on M1 -0.12 90.39 -0.29 0.7696 0.04
Age on M2 -0.31 77.72 -0.62 0.5347 0.04
Age on M3 -0.96 85.61 -1.90 0.0606 0.22
Age on M4 -1.28 83.48 -2.54 0.0129 0.26
Age on M5 -0.23 84.24 -0.44 0.6598 0.04
M1-M2 on Young -0.60 NA -1.96 0.0635 0.08
M1-M2 on Old -0.37 NA -1.16 0.2596 0.10
M2-M3 on Young -0.16 NA -0.66 0.5188 0.01
M2-M3 on Old -0.77 NA -2.72 0.0129 0.17
M3-M4 on Young 0.41 NA 1.18 0.2528 0.06
M3-M4 on Old 0.22 NA 0.69 0.4958 0.01
M4-M5 on Young -0.80 NA -1.98 0.0611 0.02
M4-M5 on Old 0.50 NA 1.29 0.2117 0.23
Interaction Sleep-Time. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1
Sleep on M1 -0.38 90.39 -0.91 0.3659 0.09
Sleep on M2 0.58 77.72 1.15 0.2536 0.11
Sleep on M3 0.11 85.61 0.22 0.8272 0.01
Sleep on M4 0.54 83.48 1.07 0.2890 0.10
Sleep on M5 -0.29 84.24 -0.55 0.5860 0.04
M1-M2 on Young -0.76 NA -3.07 0.0058 0.19
M1-M2 on Old 0.10 NA 0.30 0.7696 0.01
M2-M3 on Young -0.37 NA -1.09 0.2895 0.00
M2-M3 on Old -0.51 NA -1.71 0.1013 0.14
M3-M4 on Young 0.21 NA 0.61 0.5480 0.02
M3-M4 on Old 0.29 NA 0.83 0.4134 0.10
M4-M5 on Young 0.10 NA 0.21 0.8375 0.17
M4-M5 on Old -0.07 NA -0.12 0.9069 0.03
Main Effect Time. Design 2x2x(5xS)
Contr psihat test p.value Psihat2 p.value2 EfSize.V1
M1-M2 -0.89 -2.08 0.0503 -0.87 0.012 0.09
M2-M3 -0.94 -2.36 0.0278 -0.63 0.168 0.06
M3-M4 0.53 0.90 0.3800 0.20 0.552 0.03
M4-M5 -0.58 -0.96 0.3461 1.16 0.064 0.11
Simple Effect Time each Age-Sleep condition. Design 2x2x(5xS)
Contr psihat df test p.value Psihat2 p.value2 dif.yuen df.yuen test.yuen EffSize.yuen pvaluet.yuen
M1-M2 on Y_C -0.35 NA -1.95 0.0642 -0.25 0.172 -0.25 35 -1.28 0.12 0.2106
M1-M2 on Y_SR -0.04 NA -0.20 0.8407 -0.09 0.612 -0.09 29 -0.50 0.05 0.6210
M1-M2 on O_C -0.46 NA -3.96 0.0007 -0.67 0.000 -0.67 21 -2.53 0.27 0.0195
M1-M2 on O_SR 0.18 NA 0.82 0.4231 0.14 0.548 0.14 24 0.66 0.09 0.5135
M2-M3 on Y_C 0.11 NA 0.55 0.5884 0.14 0.532 0.14 35 0.65 0.06 0.5230
M2-M3 on Y_SR -0.13 NA -0.79 0.4402 -0.13 0.492 -0.13 29 -0.78 0.07 0.4393
M2-M3 on O_C -0.35 NA -1.42 0.1691 -0.22 0.360 -0.22 21 -0.81 0.09 0.4292
M2-M3 on O_SR -0.47 NA -3.34 0.0031 -0.42 0.060 -0.42 24 -1.57 0.25 0.1306
M3-M4 on Y_C 0.07 NA 0.36 0.7206 -0.02 0.880 -0.02 35 -0.12 0.01 0.9077
M3-M4 on Y_SR 0.35 NA 2.65 0.0150 0.28 0.096 0.28 29 2.01 0.17 0.0538
M3-M4 on O_C 0.26 NA 1.20 0.2419 -0.09 0.800 -0.09 21 -0.36 0.04 0.7203
M3-M4 on O_SR 0.08 NA 0.33 0.7468 0.03 0.768 0.03 24 0.11 0.01 0.9123
M4-M5 on Y_C -0.60 NA -1.43 0.1672 -0.02 0.996 -0.02 35 -0.05 0.01 0.9590
M4-M5 on Y_SR 0.08 NA 0.62 0.5448 0.07 0.712 0.07 29 0.55 0.05 0.5838
M4-M5 on O_C 0.79 NA 3.43 0.0025 1.01 0.000 1.01 21 4.05 0.43 0.0006
M4-M5 on O_SR 0.04 NA 0.09 0.9291 0.10 0.864 0.10 24 0.23 0.04 0.8180
Simple Effect Age-Sleep on Time=1 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.46 0.500 0.46 0.500 0.20 0.6559 0.4891 0.488 0.08
Sleep 0.53 0.469 0.53 0.469 0.58 0.4490 0.4841 0.462 0.10
Age*Sleep 0.10 0.753 0.04 0.630 0.14 0.7111 0.8364 0.757 0.04
Simple Effect Age-Sleep on Time=1 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.07 63.87 -0.91 0.3644 0.13 0.83 0.3500 0.12
Sleep on Old -0.03 43.04 -0.25 0.8032 0.04 0.06 0.7989 0.03
Age on Control -0.07 40.45 -0.66 0.5146 0.10 0.43 0.5111 0.10
Age on SR -0.02 44.40 -0.28 0.7831 0.04 0.08 0.7689 0.04
Simple Effect Age-Sleep on Time=1 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.07 63.87 -0.91 0.3644 0.12 0.83 0.3600 0.12
Sleep on Old -0.03 43.04 -0.25 0.8032 0.05 0.06 0.8144 0.05
Age on Control -0.07 40.45 -0.66 0.5146 0.13 0.43 0.5156 0.12
Age on SR -0.02 44.40 -0.28 0.7831 0.04 0.08 0.7911 0.05
YSR vs OC 0.00 35.64 0.03 0.9732 0.05 0.00 0.9756 0.04
Simple Effect Age-Sleep on Time=2 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.25 0.618 0.25 0.618 0.05 0.8190 0.5843 0.633 0.06
Sleep 0.12 0.734 0.12 0.734 0.20 0.6554 0.7529 0.730 0.03
Age*Sleep 0.02 0.895 0.02 0.850 0.00 0.9488 0.9583 0.891 0.04
Simple Effect Age-Sleep on Time=2 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.02 63.84 0.15 0.8788 0.03 0.02 0.8956 0.03
Sleep on Old 0.04 37.10 0.32 0.7471 0.06 0.11 0.7478 0.05
Age on Control -0.05 45.61 -0.40 0.6876 0.07 0.16 0.7000 0.06
Age on SR -0.03 52.80 -0.30 0.7676 0.05 0.09 0.7844 0.05
Simple Effect Age-Sleep on Time=2 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.02 63.84 0.15 0.8788 0.03 0.02 0.8733 0.03
Sleep on Old 0.04 37.10 0.32 0.7471 0.06 0.11 0.7567 0.06
Age on Control -0.05 45.61 -0.40 0.6876 0.08 0.16 0.6633 0.09
Age on SR -0.03 52.80 -0.30 0.7676 0.05 0.09 0.7856 0.05
YSR vs OC -0.07 42.53 -0.55 0.5874 0.10 0.30 0.5767 0.08
Simple Effect Age-Sleep on Time=3 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.53 0.470 0.53 0.470 0.39 0.5319 0.4658 0.473 0.08
Sleep 0.42 0.519 0.42 0.519 0.62 0.4330 0.5442 0.512 0.04
Age*Sleep 1.37 0.245 0.09 0.310 1.10 0.2948 0.2487 0.251 0.16
Simple Effect Age-Sleep on Time=3 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.04 61.52 -0.36 0.7193 0.08 0.13 0.7200 0.06
Sleep on Old 0.13 44.35 1.32 0.1942 0.20 1.74 0.1767 0.21
Age on Control -0.14 51.58 -1.36 0.1792 0.22 1.85 0.1933 0.23
Age on SR 0.03 52.94 0.31 0.7579 0.06 0.10 0.7567 0.06
Simple Effect Age-Sleep on Time=3 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.04 61.52 -0.36 0.7193 0.06 0.13 0.7356 0.07
Sleep on Old 0.13 44.35 1.32 0.1942 0.21 1.74 0.2122 0.20
Age on Control -0.14 51.58 -1.36 0.1792 0.24 1.85 0.1889 0.22
Age on SR 0.03 52.94 0.31 0.7579 0.04 0.10 0.7300 0.06
YSR vs OC -0.10 49.61 -0.93 0.3549 0.15 0.87 0.3522 0.14
Simple Effect Age-Sleep on Time=4 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 1.56 0.216 1.56 0.216 1.50 0.2225 0.1987 0.218 0.13
Sleep 0.36 0.552 0.36 0.552 0.70 0.4026 0.5860 0.544 0.04
Age*Sleep 1.10 0.296 0.09 0.330 0.94 0.3343 0.3489 0.297 0.16
Simple Effect Age-Sleep on Time=4 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.03 61.43 -0.33 0.7437 0.05 0.11 0.7544 0.06
Sleep on Old 0.11 41.58 1.14 0.2613 0.18 1.30 0.2633 0.20
Age on Control -0.15 45.95 -1.58 0.1218 0.24 2.48 0.1256 0.26
Age on SR -0.01 52.94 -0.14 0.8866 0.04 0.02 0.9011 0.04
Simple Effect Age-Sleep on Time=4 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.03 61.43 -0.33 0.7437 0.04 0.11 0.7389 0.05
Sleep on Old 0.11 41.58 1.14 0.2613 0.19 1.30 0.2478 0.20
Age on Control -0.15 45.95 -1.58 0.1218 0.24 2.48 0.1011 0.25
Age on SR -0.01 52.94 -0.14 0.8866 0.04 0.02 0.8956 0.04
YSR vs OC -0.12 46.87 -1.21 0.2333 0.21 1.46 0.2433 0.19
Simple Effect Age-Sleep on Time=5 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.11 0.746 0.11 0.746 0.77 0.3814 0.7496 0.740 0.06
Sleep 0.10 0.759 0.10 0.759 0.12 0.7285 0.7546 0.764 0.03
Age*Sleep 0.03 0.856 -0.04 0.680 0.17 0.6835 0.9316 0.864 0.08
Simple Effect Age-Sleep on Time=5 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.03 61.21 0.38 0.7053 0.05 0.14 0.7089 0.05
Sleep on Old 0.01 43.45 0.08 0.9346 0.03 0.01 0.9256 0.03
Age on Control 0.03 50.16 0.40 0.6896 0.07 0.16 0.7156 0.08
Age on SR 0.01 48.24 0.09 0.9268 0.04 0.01 0.9433 0.04
Simple Effect Age-Sleep on Time=5 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.03 61.21 0.38 0.7053 0.04 0.14 0.7100 0.06
Sleep on Old 0.01 43.45 0.08 0.9346 0.04 0.01 0.9311 0.03
Age on Control 0.03 50.16 0.40 0.6896 0.07 0.16 0.6900 0.08
Age on SR 0.01 48.24 0.09 0.9268 0.03 0.01 0.9344 0.04
YSR vs OC 0.00 49.26 0.01 0.9898 0.05 0.00 0.9967 0.05

10.3 Fig S1D Out of field firing rate {Design 2x2x(5xS)}

  NmBas="FigS1D OutOfField"
  NmFAlL<-paste0(PathDesign,NmBas)
  if (!dir.exists(NmFAlL)) {dir.create(NmFAlL)}
  NmFAlL<-paste0(NmFAlL,"/")
  ResGen<-NA
  
  rrt<-ExDataIS.2(nmF = paste0(PathDesign,"Parameters.csv"),Vars = c(1,5,6,17:21),vIntP =c(4:8),lvlCh = list("HAB"="outF_s1", "T1"="outF_s2","T2"="outF_s3","T3"="outF_s4","Test"="outF_s5"))
  DatDT<-rrt$DT
  ArP<-rrt$Arp
  ExtendDT<-rrt$ExtendDT
  
  # Simple Effects:
  DatEfS<-list()
  for(is in 1:5) {
    DatEfS[[is]]<-ExData.2(nmF = paste0(PathDesign,"Parameters.csv"),Vars = c(5:6,(6+is)))
    names(DatEfS[[is]]$DT)[3]<-"DepV"
  }
  
  # Graphs
  Grp<- Grph.3(DatP = ExtendDT,"OPR",LblsP =c("Object Exploration", "","Out of Field FR (Hz)"),ylmP =c(0,1.5),hLin = F,lvIp=5)
  Grp2=Grp
    
    #AOV
    names(rrt$DT)[4:8]<-c("T1","T2","T3","T4","T5")
    ResGen<-AOVMx2.5(A=2,B=2,C=5,DatPas = rrt,DatEfSp = DatEfS,nBMM1 = 1000,nBMM2 = 1000,Prc = 2)
    AlmacenGen2(GrpP = Grp,Grp2P = Grp2,DataPas = ResGen,PathDesignP = PathDesign,NmBasP = NmBas,Typ=2)
  
  # Other Graphs
    GrpO<-Grph.3.Otros(ExtendDT,LblsP =c("Object Exploration", "D","Out of Field FR (Hz)"))
      
    ExtendDTCol<-copy(ExtendDT)
    ExtendDTCol$Moment<-"All"
    ExtendDTCol<-data.table(rbind(ExtendDT,ExtendDTCol))
    
    Grp3<-Grph.3(DatP = ExtendDTCol,"OPR",LblsP =c("Object Exploration", "D","Out of Field FR (Hz)"),ylmP =c(0,1.5),hLin = F,lvIp = 6,wMain = T)
  
    pdf(paste0(NmFAlL,NmBas,"OtrosGraphs.pdf"))
      Grp3
      GrpO
    dev.off()
    
    # Results
        # Results
        plot(Grp)
        plot(Grp2) # Only this graph is printed in the html file.
        GrpO
        plot(Grp3)
        ResGen # Lean option to view the results of statistical analysis
        
        Kbl3(ResPas = ResGen[[1]], lbl = "Omnibus AOV. Design 2x2x(5xS)");cat("\n")
        Kbl3(ResGen[[2]], "Interaction Age-Sleep. Design 2x2x(5xS)")
        Kbl3(ResGen[[3]], "Interaction Age-Time. Design 2x2x(5xS)")
        Kbl3(ResGen[[4]], "Interaction Sleep-Time. Design 2x2x(5xS)")
        Kbl3(ResGen[[5]], "Main Effect Time. Design 2x2x(5xS)")
        Kbl3(ResGen[[6]], "Simple Effect Time each Age-Sleep condition. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[1]][[1]], "Simple Effect Age-Sleep on Time=1 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[1]][[2]], "Simple Effect Age-Sleep on Time=1 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[1]][[3]], "Simple Effect Age-Sleep on Time=1 Extense Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[2]][[1]], "Simple Effect Age-Sleep on Time=2 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[2]][[2]], "Simple Effect Age-Sleep on Time=2 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[2]][[3]], "Simple Effect Age-Sleep on Time=2 Extense Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[3]][[1]], "Simple Effect Age-Sleep on Time=3 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[3]][[2]], "Simple Effect Age-Sleep on Time=3 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[3]][[3]], "Simple Effect Age-Sleep on Time=3 Extense Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[4]][[1]], "Simple Effect Age-Sleep on Time=4 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[4]][[2]], "Simple Effect Age-Sleep on Time=4 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[4]][[3]], "Simple Effect Age-Sleep on Time=4 Extense Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[5]][[1]], "Simple Effect Age-Sleep on Time=5 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[5]][[2]], "Simple Effect Age-Sleep on Time=5 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[5]][[3]], "Simple Effect Age-Sleep on Time=5 Extense Simple Effects. Design 2x2x(5xS)")
           Eff   p.V1 p.Sig
1:   p.value.A 0.5826      
2:   p.value.B 0.8130      
3:   p.value.C 0.1185      
4:  p.value.AB 0.6344      
5:  p.value.AC 0.4708      
6:  p.value.BC 0.4174      
7: p.value.ABC 0.9933      
           Eff   p.V1 p.Sig
1:   p.value.A 0.6078      
2:   p.value.B 0.8070      
3:   p.value.C 0.1945      
4:  p.value.AB 0.7188      
5:  p.value.AC 0.5472      
6:  p.value.BC 0.5195      
7: p.value.ABC 0.9902      
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
$BP

$Bars

$MargAB

$MargAC

$MargBC

$MargC

quartz_off_screen 
                2 
$BP

$Bars

$MargAB

$MargAC

$MargBC

$MargC

$AOV
            Names    Q      p  pBoot Sig pBootMas Sig2
1:            Age 0.29 0.5916 0.5826       0.6078     
2:          Sleep 0.06 0.8095 0.8130       0.8070     
3:           Time 0.64 0.6321 0.1185       0.1945     
4:      Age*Sleep 0.22 0.6371 0.6344       0.7188     
5:       Age*Time 0.32 0.8623 0.4708       0.5472     
6:     Sleep*Time 0.34 0.8495 0.4174       0.5195     
7: Age*Sleep*Time 0.03 0.9984 0.9933       0.9902     

$InterAB
            Contr psihat     df  test p.value EfSize.V1
1: Sleep on Young  -0.04 255.76 -0.32  0.7483      0.07
2:   Sleep on Old   0.13 217.66  0.79  0.4316      0.06
3: Age on Control  -0.18 194.11 -1.32  0.1897      0.16
4:      Age on SR  -0.01 238.28 -0.08  0.9403      0.04

$InterAC
             Contr psihat    df  test p.value EfSize.V1
 1:      Age on M1  -0.03 89.94 -0.33  0.7403      0.05
 2:      Age on M2  -0.07 84.45 -0.74  0.4629      0.08
 3:      Age on M3   0.01 93.67  0.14  0.8905      0.04
 4:      Age on M4  -0.12 87.54 -1.29  0.2010      0.14
 5:      Age on M5   0.01 81.51  0.14  0.8887      0.03
 6: M1-M2 on Young  -0.12    NA -1.70  0.1044      0.07
 7:   M1-M2 on Old  -0.14    NA -2.44  0.0237      0.11
 8: M2-M3 on Young  -0.02    NA -0.41  0.6889      0.04
 9:   M2-M3 on Old   0.05    NA  0.93  0.3616      0.06
10: M3-M4 on Young   0.12    NA  3.02  0.0065      0.11
11:   M3-M4 on Old  -0.06    NA -0.81  0.4254      0.05
12: M4-M5 on Young   0.01    NA  0.26  0.7939      0.04
13:   M4-M5 on Old   0.21    NA  2.45  0.0234      0.19

$InterBC
             Contr psihat    df  test p.value EfSize.V1
 1:    Sleep on M1  -0.05 89.94 -0.59  0.5540      0.08
 2:    Sleep on M2   0.01 84.45  0.11  0.9104      0.01
 3:    Sleep on M3  -0.03 93.67 -0.25  0.8002      0.02
 4:    Sleep on M4   0.03 87.54  0.32  0.7506      0.02
 5:    Sleep on M5   0.12 81.51  1.39  0.1674      0.15
 6: M1-M2 on Young  -0.15    NA -4.01  0.0006      0.13
 7:   M1-M2 on Old  -0.09    NA -1.43  0.1686      0.05
 8: M2-M3 on Young   0.04    NA  0.60  0.5547      0.01
 9:   M2-M3 on Old  -0.03    NA -0.73  0.4732      0.01
10: M3-M4 on Young   0.02    NA  0.29  0.7719      0.02
11:   M3-M4 on Old   0.04    NA  0.98  0.3377      0.06
12: M4-M5 on Young   0.05    NA  0.88  0.3884      0.05
13:   M4-M5 on Old   0.13    NA  1.87  0.0755      0.17

$DetallMainC
   Contr psihat  test p.value Psihat2 p.value2 EfSize.V1
1: M1-M2  -0.27 -3.57  0.0018   -0.15    0.068      0.09
2: M2-M3   0.04  0.43  0.6739    0.02    0.788      0.00
3: M3-M4   0.04  0.37  0.7133    0.04    0.568      0.04
4: M4-M5   0.15  1.75  0.0952    0.20    0.064      0.11

$DetallTrialCadaCondAB
            Contr psihat df  test p.value Psihat2 p.value2 dif.yuen df.yuen
 1:  M1-M2 on Y_C  -0.08 NA -1.99  0.0599   -0.04    0.148    -0.04      35
 2: M1-M2 on Y_SR  -0.02 NA -0.72  0.4824   -0.01    0.692    -0.01      29
 3:  M1-M2 on O_C  -0.09 NA -2.47  0.0223   -0.06    0.292    -0.06      21
 4: M1-M2 on O_SR  -0.02 NA -0.51  0.6162   -0.03    0.516    -0.03      24
 5:  M2-M3 on Y_C   0.01 NA  0.40  0.6958   -0.01    0.636    -0.01      35
 6: M2-M3 on Y_SR  -0.01 NA -0.49  0.6315   -0.02    0.640    -0.02      29
 7:  M2-M3 on O_C   0.02 NA  0.62  0.5419    0.04    0.392     0.04      21
 8: M2-M3 on O_SR   0.01 NA  0.26  0.7975    0.01    0.764     0.01      24
 9:  M3-M4 on Y_C   0.04 NA  1.28  0.2155    0.04    0.056     0.04      35
10: M3-M4 on Y_SR   0.05 NA  1.83  0.0812    0.05    0.216     0.05      29
11:  M3-M4 on O_C   0.00 NA  0.06  0.9566   -0.05    0.376    -0.05      21
12: M3-M4 on O_SR  -0.02 NA -0.51  0.6139    0.00    0.944     0.00      24
13:  M4-M5 on Y_C   0.02 NA  0.51  0.6155   -0.01    0.868    -0.01      35
14: M4-M5 on Y_SR   0.03 NA  1.37  0.1851    0.04    0.116     0.04      29
15:  M4-M5 on O_C   0.09 NA  2.78  0.0111    0.06    0.196     0.06      21
16: M4-M5 on O_SR   0.13 NA  2.32  0.0303    0.10    0.168     0.10      24
    test.yuen EffSize.yuen pvaluet.yuen
 1:     -1.46         0.13       0.1523
 2:     -0.30         0.03       0.7669
 3:     -1.12         0.16       0.2765
 4:     -0.69         0.08       0.4955
 5:     -0.55         0.04       0.5868
 6:     -0.48         0.04       0.6345
 7:      0.79         0.10       0.4382
 8:      0.30         0.02       0.7649
 9:      1.91         0.11       0.0648
10:      1.19         0.11       0.2420
11:     -0.76         0.12       0.4557
12:      0.08         0.01       0.9373
13:     -0.22         0.02       0.8288
14:      1.56         0.12       0.1291
15:      1.25         0.17       0.2241
16:      1.57         0.21       0.1285

$DetallSimple
$DetallSimple[[1]]
$DetallSimple[[1]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 0.46 0.500   0.46  0.500  0.20 0.6559 0.4891        0.482       
2:     Sleep 0.53 0.469   0.53  0.469  0.58 0.4490 0.4841        0.478       
3: Age*Sleep 0.10 0.753   0.04  0.630  0.14 0.7111 0.8364        0.742       
   EffSize
1:    0.08
2:    0.10
3:    0.04

$DetallSimple[[1]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.07 63.87 -0.91  0.3644      0.13      0.83 0.3789
2:   Sleep on Old  -0.03 43.04 -0.25  0.8032      0.04      0.06 0.7911
3: Age on Control  -0.07 40.45 -0.66  0.5146      0.10      0.43 0.5422
4:      Age on SR  -0.02 44.40 -0.28  0.7831      0.05      0.08 0.7822
   EffSize.Boot
1:         0.13
2:         0.04
3:         0.10
4:         0.05

$DetallSimple[[1]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.07 63.87 -0.91  0.3644      0.13      0.83 0.3756
2:   Sleep on Old  -0.03 43.04 -0.25  0.8032      0.05      0.06 0.8156
3: Age on Control  -0.07 40.45 -0.66  0.5146      0.11      0.43 0.5278
4:      Age on SR  -0.02 44.40 -0.28  0.7831      0.04      0.08 0.7822
5:      YSR vs OC   0.00 35.64  0.03  0.9732      0.05      0.00 0.9756
   EffSize.Boot
1:         0.12
2:         0.05
3:         0.12
4:         0.05
5:         0.04


$DetallSimple[[2]]
$DetallSimple[[2]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 0.25 0.618   0.25  0.618  0.05 0.8190 0.5843        0.597       
2:     Sleep 0.12 0.734   0.12  0.734  0.20 0.6554 0.7529        0.733       
3: Age*Sleep 0.02 0.895   0.02  0.850  0.00 0.9488 0.9583        0.898       
   EffSize
1:    0.06
2:    0.03
3:    0.04

$DetallSimple[[2]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.02 63.84  0.15  0.8788      0.04      0.02 0.8756
2:   Sleep on Old   0.04 37.10  0.32  0.7471      0.06      0.11 0.7411
3: Age on Control  -0.05 45.61 -0.40  0.6876      0.06      0.16 0.6811
4:      Age on SR  -0.03 52.80 -0.30  0.7676      0.05      0.09 0.7667
   EffSize.Boot
1:         0.03
2:         0.06
3:         0.08
4:         0.05

$DetallSimple[[2]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.02 63.84  0.15  0.8788      0.03      0.02 0.8744
2:   Sleep on Old   0.04 37.10  0.32  0.7471      0.05      0.11 0.7689
3: Age on Control  -0.05 45.61 -0.40  0.6876      0.08      0.16 0.7022
4:      Age on SR  -0.03 52.80 -0.30  0.7676      0.05      0.09 0.7589
5:      YSR vs OC  -0.07 42.53 -0.55  0.5874      0.10      0.30 0.5767
   EffSize.Boot
1:         0.03
2:         0.05
3:         0.08
4:         0.05
5:         0.08


$DetallSimple[[3]]
$DetallSimple[[3]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 0.53 0.470   0.53  0.470  0.39 0.5319 0.4658        0.449       
2:     Sleep 0.42 0.519   0.42  0.519  0.62 0.4330 0.5442        0.526       
3: Age*Sleep 1.37 0.245   0.09  0.310  1.10 0.2948 0.2487        0.252       
   EffSize
1:    0.08
2:    0.04
3:    0.16

$DetallSimple[[3]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.04 61.52 -0.36  0.7193      0.06      0.13 0.7111
2:   Sleep on Old   0.13 44.35  1.32  0.1942      0.21      1.74 0.1867
3: Age on Control  -0.14 51.58 -1.36  0.1792      0.26      1.85 0.1678
4:      Age on SR   0.03 52.94  0.31  0.7579      0.05      0.10 0.7656
   EffSize.Boot
1:         0.05
2:         0.20
3:         0.21
4:         0.05

$DetallSimple[[3]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.04 61.52 -0.36  0.7193      0.06      0.13 0.7444
2:   Sleep on Old   0.13 44.35  1.32  0.1942      0.20      1.74 0.1778
3: Age on Control  -0.14 51.58 -1.36  0.1792      0.22      1.85 0.1733
4:      Age on SR   0.03 52.94  0.31  0.7579      0.05      0.10 0.7478
5:      YSR vs OC  -0.10 49.61 -0.93  0.3549      0.15      0.87 0.3522
   EffSize.Boot
1:         0.07
2:         0.20
3:         0.22
4:         0.06
5:         0.14


$DetallSimple[[4]]
$DetallSimple[[4]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 1.56 0.216   1.56  0.216  1.50 0.2225 0.1987        0.219       
2:     Sleep 0.36 0.552   0.36  0.552  0.70 0.4026 0.5860        0.582       
3: Age*Sleep 1.10 0.296   0.09  0.330  0.94 0.3343 0.3489        0.288       
   EffSize
1:    0.13
2:    0.04
3:    0.16

$DetallSimple[[4]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.03 61.43 -0.33  0.7437      0.05      0.11 0.7222
2:   Sleep on Old   0.11 41.58  1.14  0.2613      0.20      1.30 0.2600
3: Age on Control  -0.15 45.95 -1.58  0.1218      0.21      2.48 0.1311
4:      Age on SR  -0.01 52.94 -0.14  0.8866      0.04      0.02 0.8911
   EffSize.Boot
1:         0.06
2:         0.19
3:         0.26
4:         0.05

$DetallSimple[[4]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.03 61.43 -0.33  0.7437      0.05      0.11 0.7356
2:   Sleep on Old   0.11 41.58  1.14  0.2613      0.19      1.30 0.2878
3: Age on Control  -0.15 45.95 -1.58  0.1218      0.23      2.48 0.1244
4:      Age on SR  -0.01 52.94 -0.14  0.8866      0.04      0.02 0.8733
5:      YSR vs OC  -0.12 46.87 -1.21  0.2333      0.21      1.46 0.2433
   EffSize.Boot
1:         0.05
2:         0.20
3:         0.23
4:         0.04
5:         0.19


$DetallSimple[[5]]
$DetallSimple[[5]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 0.11 0.746   0.11  0.746  0.77 0.3814 0.7496        0.746       
2:     Sleep 0.10 0.759   0.10  0.759  0.12 0.7285 0.7546        0.782       
3: Age*Sleep 0.03 0.856  -0.04  0.680  0.17 0.6835 0.9316        0.846       
   EffSize
1:    0.06
2:    0.03
3:    0.08

$DetallSimple[[5]]$Detall
            Contr psihat    df test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.03 61.21 0.38  0.7053      0.05      0.14 0.6889
2:   Sleep on Old   0.01 43.45 0.08  0.9346      0.04      0.01 0.9189
3: Age on Control   0.03 50.16 0.40  0.6896      0.07      0.16 0.6633
4:      Age on SR   0.01 48.24 0.09  0.9268      0.04      0.01 0.9067
   EffSize.Boot
1:         0.06
2:         0.03
3:         0.08
4:         0.03

$DetallSimple[[5]]$DetallExt
            Contr psihat    df test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.03 61.21 0.38  0.7053      0.05      0.14 0.7011
2:   Sleep on Old   0.01 43.45 0.08  0.9346      0.04      0.01 0.9344
3: Age on Control   0.03 50.16 0.40  0.6896      0.09      0.16 0.6867
4:      Age on SR   0.01 48.24 0.09  0.9268      0.03      0.01 0.9289
5:      YSR vs OC   0.00 49.26 0.01  0.9898      0.05      0.00 0.9967
   EffSize.Boot
1:         0.05
2:         0.03
3:         0.09
4:         0.03
5:         0.05
Omnibus AOV. Design 2x2x(5xS)
Names Q p pBoot Sig pBootMas Sig2
Age 0.29 0.5916 0.5826 0.6078
Sleep 0.06 0.8095 0.8130 0.8070
Time 0.64 0.6321 0.1185 0.1945
Age*Sleep 0.22 0.6371 0.6344 0.7188
Age*Time 0.32 0.8623 0.4708 0.5472
Sleep*Time 0.34 0.8495 0.4174 0.5195
AgeSleepTime 0.03 0.9984 0.9933 0.9902
Interaction Age-Sleep. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1
Sleep on Young -0.04 255.76 -0.32 0.7483 0.07
Sleep on Old 0.13 217.66 0.79 0.4316 0.06
Age on Control -0.18 194.11 -1.32 0.1897 0.16
Age on SR -0.01 238.28 -0.08 0.9403 0.04
Interaction Age-Time. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1
Age on M1 -0.03 89.94 -0.33 0.7403 0.05
Age on M2 -0.07 84.45 -0.74 0.4629 0.08
Age on M3 0.01 93.67 0.14 0.8905 0.04
Age on M4 -0.12 87.54 -1.29 0.2010 0.14
Age on M5 0.01 81.51 0.14 0.8887 0.03
M1-M2 on Young -0.12 NA -1.70 0.1044 0.07
M1-M2 on Old -0.14 NA -2.44 0.0237 0.11
M2-M3 on Young -0.02 NA -0.41 0.6889 0.04
M2-M3 on Old 0.05 NA 0.93 0.3616 0.06
M3-M4 on Young 0.12 NA 3.02 0.0065 0.11
M3-M4 on Old -0.06 NA -0.81 0.4254 0.05
M4-M5 on Young 0.01 NA 0.26 0.7939 0.04
M4-M5 on Old 0.21 NA 2.45 0.0234 0.19
Interaction Sleep-Time. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1
Sleep on M1 -0.05 89.94 -0.59 0.5540 0.08
Sleep on M2 0.01 84.45 0.11 0.9104 0.01
Sleep on M3 -0.03 93.67 -0.25 0.8002 0.02
Sleep on M4 0.03 87.54 0.32 0.7506 0.02
Sleep on M5 0.12 81.51 1.39 0.1674 0.15
M1-M2 on Young -0.15 NA -4.01 0.0006 0.13
M1-M2 on Old -0.09 NA -1.43 0.1686 0.05
M2-M3 on Young 0.04 NA 0.60 0.5547 0.01
M2-M3 on Old -0.03 NA -0.73 0.4732 0.01
M3-M4 on Young 0.02 NA 0.29 0.7719 0.02
M3-M4 on Old 0.04 NA 0.98 0.3377 0.06
M4-M5 on Young 0.05 NA 0.88 0.3884 0.05
M4-M5 on Old 0.13 NA 1.87 0.0755 0.17
Main Effect Time. Design 2x2x(5xS)
Contr psihat test p.value Psihat2 p.value2 EfSize.V1
M1-M2 -0.27 -3.57 0.0018 -0.15 0.068 0.09
M2-M3 0.04 0.43 0.6739 0.02 0.788 0.00
M3-M4 0.04 0.37 0.7133 0.04 0.568 0.04
M4-M5 0.15 1.75 0.0952 0.20 0.064 0.11
Simple Effect Time each Age-Sleep condition. Design 2x2x(5xS)
Contr psihat df test p.value Psihat2 p.value2 dif.yuen df.yuen test.yuen EffSize.yuen pvaluet.yuen
M1-M2 on Y_C -0.08 NA -1.99 0.0599 -0.04 0.148 -0.04 35 -1.46 0.13 0.1523
M1-M2 on Y_SR -0.02 NA -0.72 0.4824 -0.01 0.692 -0.01 29 -0.30 0.03 0.7669
M1-M2 on O_C -0.09 NA -2.47 0.0223 -0.06 0.292 -0.06 21 -1.12 0.16 0.2765
M1-M2 on O_SR -0.02 NA -0.51 0.6162 -0.03 0.516 -0.03 24 -0.69 0.08 0.4955
M2-M3 on Y_C 0.01 NA 0.40 0.6958 -0.01 0.636 -0.01 35 -0.55 0.04 0.5868
M2-M3 on Y_SR -0.01 NA -0.49 0.6315 -0.02 0.640 -0.02 29 -0.48 0.04 0.6345
M2-M3 on O_C 0.02 NA 0.62 0.5419 0.04 0.392 0.04 21 0.79 0.10 0.4382
M2-M3 on O_SR 0.01 NA 0.26 0.7975 0.01 0.764 0.01 24 0.30 0.02 0.7649
M3-M4 on Y_C 0.04 NA 1.28 0.2155 0.04 0.056 0.04 35 1.91 0.11 0.0648
M3-M4 on Y_SR 0.05 NA 1.83 0.0812 0.05 0.216 0.05 29 1.19 0.11 0.2420
M3-M4 on O_C 0.00 NA 0.06 0.9566 -0.05 0.376 -0.05 21 -0.76 0.12 0.4557
M3-M4 on O_SR -0.02 NA -0.51 0.6139 0.00 0.944 0.00 24 0.08 0.01 0.9373
M4-M5 on Y_C 0.02 NA 0.51 0.6155 -0.01 0.868 -0.01 35 -0.22 0.02 0.8288
M4-M5 on Y_SR 0.03 NA 1.37 0.1851 0.04 0.116 0.04 29 1.56 0.12 0.1291
M4-M5 on O_C 0.09 NA 2.78 0.0111 0.06 0.196 0.06 21 1.25 0.17 0.2241
M4-M5 on O_SR 0.13 NA 2.32 0.0303 0.10 0.168 0.10 24 1.57 0.21 0.1285
Simple Effect Age-Sleep on Time=1 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.46 0.500 0.46 0.500 0.20 0.6559 0.4891 0.482 0.08
Sleep 0.53 0.469 0.53 0.469 0.58 0.4490 0.4841 0.478 0.10
Age*Sleep 0.10 0.753 0.04 0.630 0.14 0.7111 0.8364 0.742 0.04
Simple Effect Age-Sleep on Time=1 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.07 63.87 -0.91 0.3644 0.13 0.83 0.3789 0.13
Sleep on Old -0.03 43.04 -0.25 0.8032 0.04 0.06 0.7911 0.04
Age on Control -0.07 40.45 -0.66 0.5146 0.10 0.43 0.5422 0.10
Age on SR -0.02 44.40 -0.28 0.7831 0.05 0.08 0.7822 0.05
Simple Effect Age-Sleep on Time=1 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.07 63.87 -0.91 0.3644 0.13 0.83 0.3756 0.12
Sleep on Old -0.03 43.04 -0.25 0.8032 0.05 0.06 0.8156 0.05
Age on Control -0.07 40.45 -0.66 0.5146 0.11 0.43 0.5278 0.12
Age on SR -0.02 44.40 -0.28 0.7831 0.04 0.08 0.7822 0.05
YSR vs OC 0.00 35.64 0.03 0.9732 0.05 0.00 0.9756 0.04
Simple Effect Age-Sleep on Time=2 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.25 0.618 0.25 0.618 0.05 0.8190 0.5843 0.597 0.06
Sleep 0.12 0.734 0.12 0.734 0.20 0.6554 0.7529 0.733 0.03
Age*Sleep 0.02 0.895 0.02 0.850 0.00 0.9488 0.9583 0.898 0.04
Simple Effect Age-Sleep on Time=2 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.02 63.84 0.15 0.8788 0.04 0.02 0.8756 0.03
Sleep on Old 0.04 37.10 0.32 0.7471 0.06 0.11 0.7411 0.06
Age on Control -0.05 45.61 -0.40 0.6876 0.06 0.16 0.6811 0.08
Age on SR -0.03 52.80 -0.30 0.7676 0.05 0.09 0.7667 0.05
Simple Effect Age-Sleep on Time=2 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.02 63.84 0.15 0.8788 0.03 0.02 0.8744 0.03
Sleep on Old 0.04 37.10 0.32 0.7471 0.05 0.11 0.7689 0.05
Age on Control -0.05 45.61 -0.40 0.6876 0.08 0.16 0.7022 0.08
Age on SR -0.03 52.80 -0.30 0.7676 0.05 0.09 0.7589 0.05
YSR vs OC -0.07 42.53 -0.55 0.5874 0.10 0.30 0.5767 0.08
Simple Effect Age-Sleep on Time=3 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.53 0.470 0.53 0.470 0.39 0.5319 0.4658 0.449 0.08
Sleep 0.42 0.519 0.42 0.519 0.62 0.4330 0.5442 0.526 0.04
Age*Sleep 1.37 0.245 0.09 0.310 1.10 0.2948 0.2487 0.252 0.16
Simple Effect Age-Sleep on Time=3 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.04 61.52 -0.36 0.7193 0.06 0.13 0.7111 0.05
Sleep on Old 0.13 44.35 1.32 0.1942 0.21 1.74 0.1867 0.20
Age on Control -0.14 51.58 -1.36 0.1792 0.26 1.85 0.1678 0.21
Age on SR 0.03 52.94 0.31 0.7579 0.05 0.10 0.7656 0.05
Simple Effect Age-Sleep on Time=3 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.04 61.52 -0.36 0.7193 0.06 0.13 0.7444 0.07
Sleep on Old 0.13 44.35 1.32 0.1942 0.20 1.74 0.1778 0.20
Age on Control -0.14 51.58 -1.36 0.1792 0.22 1.85 0.1733 0.22
Age on SR 0.03 52.94 0.31 0.7579 0.05 0.10 0.7478 0.06
YSR vs OC -0.10 49.61 -0.93 0.3549 0.15 0.87 0.3522 0.14
Simple Effect Age-Sleep on Time=4 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 1.56 0.216 1.56 0.216 1.50 0.2225 0.1987 0.219 0.13
Sleep 0.36 0.552 0.36 0.552 0.70 0.4026 0.5860 0.582 0.04
Age*Sleep 1.10 0.296 0.09 0.330 0.94 0.3343 0.3489 0.288 0.16
Simple Effect Age-Sleep on Time=4 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.03 61.43 -0.33 0.7437 0.05 0.11 0.7222 0.06
Sleep on Old 0.11 41.58 1.14 0.2613 0.20 1.30 0.2600 0.19
Age on Control -0.15 45.95 -1.58 0.1218 0.21 2.48 0.1311 0.26
Age on SR -0.01 52.94 -0.14 0.8866 0.04 0.02 0.8911 0.05
Simple Effect Age-Sleep on Time=4 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.03 61.43 -0.33 0.7437 0.05 0.11 0.7356 0.05
Sleep on Old 0.11 41.58 1.14 0.2613 0.19 1.30 0.2878 0.20
Age on Control -0.15 45.95 -1.58 0.1218 0.23 2.48 0.1244 0.23
Age on SR -0.01 52.94 -0.14 0.8866 0.04 0.02 0.8733 0.04
YSR vs OC -0.12 46.87 -1.21 0.2333 0.21 1.46 0.2433 0.19
Simple Effect Age-Sleep on Time=5 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.11 0.746 0.11 0.746 0.77 0.3814 0.7496 0.746 0.06
Sleep 0.10 0.759 0.10 0.759 0.12 0.7285 0.7546 0.782 0.03
Age*Sleep 0.03 0.856 -0.04 0.680 0.17 0.6835 0.9316 0.846 0.08
Simple Effect Age-Sleep on Time=5 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.03 61.21 0.38 0.7053 0.05 0.14 0.6889 0.06
Sleep on Old 0.01 43.45 0.08 0.9346 0.04 0.01 0.9189 0.03
Age on Control 0.03 50.16 0.40 0.6896 0.07 0.16 0.6633 0.08
Age on SR 0.01 48.24 0.09 0.9268 0.04 0.01 0.9067 0.03
Simple Effect Age-Sleep on Time=5 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.03 61.21 0.38 0.7053 0.05 0.14 0.7011 0.05
Sleep on Old 0.01 43.45 0.08 0.9346 0.04 0.01 0.9344 0.03
Age on Control 0.03 50.16 0.40 0.6896 0.09 0.16 0.6867 0.09
Age on SR 0.01 48.24 0.09 0.9268 0.03 0.01 0.9289 0.03
YSR vs OC 0.00 49.26 0.01 0.9898 0.05 0.00 0.9967 0.05

10.4 Fig S1E Number of fields {Design 2x2x(5xS)}

  NmBas="FigS1E NumberOfFields"
  NmFAlL<-paste0(PathDesign,NmBas)
  if (!dir.exists(NmFAlL)) {dir.create(NmFAlL)}
  NmFAlL<-paste0(NmFAlL,"/")
  ResGen<-NA
  
  rrt<-ExDataIS.2(nmF = paste0(PathDesign,"Parameters.csv"),Vars = c(1,5,6,22:26),vIntP =c(4:8),lvlCh = list("HAB"="NOfF_s1", "T1"="NOfF_s2","T2"="NOfF_s3","T3"="NOfF_s4","Test"="NOfF_s5"))
  DatDT<-rrt$DT
  ArP<-rrt$Arp
  ExtendDT<-rrt$ExtendDT
  
  # Simple Effects:
  DatEfS<-list()
  for(is in 1:5) {
    DatEfS[[is]]<-ExData.2(nmF = paste0(PathDesign,"Parameters.csv"),Vars = c(5:6,(6+is)))
    names(DatEfS[[is]]$DT)[3]<-"DepV"
  }
  
  # Graphs
  Grp<- Grph.3(DatP = ExtendDT,"OPR",LblsP =c("Object Exploration", "","Number of Fields"),ylmP =c(0,3),hLin = F,lvIp=5)
  Grp2=Grp
    
    #AOV
    #A=2;B=2;C=5;DatPas=rrt;DatEfSp=DatEfS;nBMM1=nBMM2=1000;Prc=2
    names(rrt$DT)[4:8]<-c("T1","T2","T3","T4","T5")
    ResGen<-AOVMx2.5(A=2,B=2,C=5,DatPas = rrt,DatEfSp = DatEfS,nBMM1 = 1000,nBMM2 = 1000,Prc = 2)
 
    AlmacenGen2(GrpP = Grp,Grp2P = Grp2,DataPas = ResGen,PathDesignP = PathDesign,NmBasP = NmBas,Typ=2)
  
  # Other Graphs
    GrpO<-Grph.3.Otros(ExtendDT,LblsP =c("Object Exploration", "E","Number of Fields"))
 
    ExtendDTCol<-copy(ExtendDT)
    ExtendDTCol$Moment<-"All"
    ExtendDTCol<-data.table(rbind(ExtendDT,ExtendDTCol))
    
    Grp3<-Grph.3(DatP = ExtendDTCol,"OPR",LblsP =c("Object Exploration", "E","Number of Fields"),ylmP =c(0,3),hLin = F,lvIp = 6,wMain = T)
   
    pdf(paste0(NmFAlL,NmBas,"OtrosGraphs.pdf"))
      Grp3
      GrpO
    dev.off()
    
    # Results
        # Results
        plot(Grp)
        plot(Grp2) # Only this graph is printed in the html file.
        GrpO
        plot(Grp3)
        ResGen # Lean option to view the results of statistical analysis
        
        Kbl3(ResPas = ResGen[[1]], lbl = "Omnibus AOV. Design 2x2x(5xS)");cat("\n")
        Kbl3(ResGen[[2]], "Interaction Age-Sleep. Design 2x2x(5xS)")
        Kbl3(ResGen[[3]], "Interaction Age-Time. Design 2x2x(5xS)")
        Kbl3(ResGen[[4]], "Interaction Sleep-Time. Design 2x2x(5xS)")
        Kbl3(ResGen[[5]], "Main Effect Time. Design 2x2x(5xS)")
        Kbl3(ResGen[[6]], "Simple Effect Time each Age-Sleep condition. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[1]][[1]], "Simple Effect Age-Sleep on Time=1 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[1]][[2]], "Simple Effect Age-Sleep on Time=1 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[1]][[3]], "Simple Effect Age-Sleep on Time=1 Extense Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[2]][[1]], "Simple Effect Age-Sleep on Time=2 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[2]][[2]], "Simple Effect Age-Sleep on Time=2 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[2]][[3]], "Simple Effect Age-Sleep on Time=2 Extense Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[3]][[1]], "Simple Effect Age-Sleep on Time=3 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[3]][[2]], "Simple Effect Age-Sleep on Time=3 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[3]][[3]], "Simple Effect Age-Sleep on Time=3 Extense Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[4]][[1]], "Simple Effect Age-Sleep on Time=4 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[4]][[2]], "Simple Effect Age-Sleep on Time=4 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[4]][[3]], "Simple Effect Age-Sleep on Time=4 Extense Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[5]][[1]], "Simple Effect Age-Sleep on Time=5 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[5]][[2]], "Simple Effect Age-Sleep on Time=5 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[5]][[3]], "Simple Effect Age-Sleep on Time=5 Extense Simple Effects. Design 2x2x(5xS)")
           Eff   p.V1 p.Sig
1:   p.value.A 0.7863      
2:   p.value.B 0.6427      
3:   p.value.C 0.9900      
4:  p.value.AB 0.1052      
5:  p.value.AC 0.8164      
6:  p.value.BC 0.4157      
7: p.value.ABC 0.7095      
           Eff   p.V1 p.Sig
1:   p.value.A 0.7512      
2:   p.value.B 0.6262      
3:   p.value.C 0.9902      
4:  p.value.AB 0.0000 *    
5:  p.value.AC 0.8508      
6:  p.value.BC 0.5038      
7: p.value.ABC 0.7775      
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
$BP

$Bars

$MargAB

$MargAC

$MargBC

$MargC

quartz_off_screen 
                2 
$BP

$Bars

$MargAB

$MargAC

$MargBC

$MargC

$AOV
            Names    Q      p  pBoot Sig pBootMas  Sig2
1:            Age 0.11 0.7436 0.7863       0.7512      
2:          Sleep 0.23 0.6290 0.6427       0.6262      
3:           Time 0.03 0.9983 0.9900       0.9902      
4:      Age*Sleep 2.85 0.0914 0.1052       0.0000 *    
5:       Age*Time 0.13 0.9728 0.8164       0.8508      
6:     Sleep*Time 0.33 0.8592 0.4157       0.5038      
7: Age*Sleep*Time 0.17 0.9535 0.7095       0.7775      

$InterAB
            Contr psihat     df  test p.value EfSize.V1
1: Sleep on Young   0.58 310.01  1.68  0.0934      0.26
2:   Sleep on Old  -0.42 219.08 -1.00  0.3175      0.15
3: Age on Control   0.50 222.29  1.32  0.1879      0.22
4:      Age on SR  -0.50 246.57 -1.29  0.1984      0.30

$InterAC
             Contr psihat    df  test p.value EfSize.V1
 1:      Age on M1  -0.02 93.70 -0.07  0.9448      0.04
 2:      Age on M2   0.02 94.20  0.09  0.9263      0.04
 3:      Age on M3  -0.04 87.95 -0.16  0.8699      0.04
 4:      Age on M4   0.21 97.98  0.89  0.3768      0.08
 5:      Age on M5  -0.17 95.24 -0.70  0.4885      0.08
 6: M1-M2 on Young   0.00    NA  0.00  1.0000      0.01
 7:   M1-M2 on Old   0.23    NA  1.01  0.3218      0.02
 8: M2-M3 on Young  -0.27    NA -1.20  0.2443      0.04
 9:   M2-M3 on Old  -0.05    NA -0.19  0.8507      0.02
10: M3-M4 on Young   0.18    NA  0.83  0.4176      0.03
11:   M3-M4 on Old   0.14    NA  0.55  0.5874      0.08
12: M4-M5 on Young   0.00    NA  0.00  1.0000      0.03
13:   M4-M5 on Old  -0.32    NA -1.45  0.1630      0.14

$InterBC
             Contr psihat    df  test p.value EfSize.V1
 1:    Sleep on M1   0.40 93.70  1.65  0.1021      0.20
 2:    Sleep on M2  -0.19 94.20 -0.77  0.4416      0.07
 3:    Sleep on M3   0.18 87.95  0.74  0.4613      0.12
 4:    Sleep on M4  -0.18 97.98 -0.78  0.4400      0.07
 5:    Sleep on M5  -0.04 95.24 -0.17  0.8628      0.03
 6: M1-M2 on Young   0.50    NA  1.44  0.1638      0.14
 7:   M1-M2 on Old  -0.09    NA -0.39  0.7000      0.12
 8: M2-M3 on Young  -0.41    NA -1.29  0.2098      0.06
 9:   M2-M3 on Old   0.18    NA  0.83  0.4176      0.14
10: M3-M4 on Young   0.27    NA  1.97  0.0625      0.10
11:   M3-M4 on Old  -0.14    NA -0.53  0.6016      0.09
12: M4-M5 on Young  -0.18    NA -0.87  0.3927      0.05
13:   M4-M5 on Old   0.00    NA  0.00  1.0000      0.02

$DetallMainC
   Contr psihat  test p.value Psihat2 p.value2 EfSize.V1
1: M1-M2   0.55  1.51  0.1451    0.05    0.820      0.02
2: M2-M3  -0.05 -0.10  0.9191    0.12    0.720      0.03
3: M3-M4   0.27  0.78  0.4458    0.06    0.876      0.01
4: M4-M5  -0.27 -1.14  0.2653   -0.23    0.404      0.03

$DetallTrialCadaCondAB
            Contr psihat df  test p.value Psihat2 p.value2 dif.yuen df.yuen
 1:  M1-M2 on Y_C   0.18 NA  0.79  0.4398    0.14    0.360     0.14      35
 2: M1-M2 on Y_SR  -0.05 NA -0.39  0.7023   -0.13    0.394    -0.13      29
 3:  M1-M2 on O_C   0.23 NA  1.67  0.1089    0.18    0.272     0.18      21
 4: M1-M2 on O_SR  -0.14 NA -1.07  0.2988   -0.14    0.386    -0.17      23
 5:  M2-M3 on Y_C  -0.45 NA -3.14  0.0050   -0.11    0.492    -0.11      35
 6: M2-M3 on Y_SR   0.14 NA  1.07  0.2988    0.20    0.124     0.23      30
 7:  M2-M3 on O_C  -0.05 NA -0.24  0.8156   -0.01    0.886    -0.05      20
 8: M2-M3 on O_SR  -0.05 NA -0.21  0.8359    0.04    0.844     0.00      24
 9:  M3-M4 on Y_C   0.27 NA  1.97  0.0625    0.11    0.412     0.11      35
10: M3-M4 on Y_SR  -0.09 NA -0.74  0.4683   -0.20    0.134    -0.17      28
11:  M3-M4 on O_C   0.05 NA  0.39  0.7023    0.10    0.510     0.10      20
12: M3-M4 on O_SR   0.09 NA  0.36  0.7231    0.05    0.752     0.04      23
13:  M4-M5 on Y_C   0.18 NA  0.87  0.3927    0.04    0.790     0.03      33
14: M4-M5 on Y_SR   0.00 NA  0.00  1.0000    0.03    0.906     0.00      29
15:  M4-M5 on O_C  -0.18 NA -1.38  0.1835   -0.23    0.228    -0.18      21
16: M4-M5 on O_SR  -0.05 NA -0.21  0.8359   -0.08    0.644    -0.08      24
    test.yuen EffSize.yuen pvaluet.yuen
 1:      0.89         0.13       0.3787
 2:     -0.89         0.13       0.3826
 3:      1.06         0.17       0.3005
 4:     -0.93         0.11       0.3603
 5:     -0.81         0.10       0.4236
 6:      1.62         0.22       0.1150
 7:     -0.27         0.00       0.7892
 8:      0.00         0.04       1.0000
 9:      0.94         0.10       0.3553
10:     -1.21         0.19       0.2361
11:      0.57         0.09       0.5776
12:      0.24         0.04       0.8143
13:      0.20         0.03       0.8450
14:      0.00         0.03       1.0000
15:     -1.15         0.17       0.2627
16:     -0.44         0.07       0.6644

$DetallSimple
$DetallSimple[[1]]
$DetallSimple[[1]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 0.46 0.500   0.46  0.500  0.20 0.6559 0.4891        0.527       
2:     Sleep 0.53 0.469   0.53  0.469  0.58 0.4490 0.4841        0.470       
3: Age*Sleep 0.10 0.753   0.04  0.630  0.14 0.7111 0.8364        0.759       
   EffSize
1:    0.08
2:    0.10
3:    0.04

$DetallSimple[[1]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.07 63.87 -0.91  0.3644      0.12      0.83 0.3389
2:   Sleep on Old  -0.03 43.04 -0.25  0.8032      0.05      0.06 0.8067
3: Age on Control  -0.07 40.45 -0.66  0.5146      0.11      0.43 0.5333
4:      Age on SR  -0.02 44.40 -0.28  0.7831      0.04      0.08 0.8033
   EffSize.Boot
1:         0.11
2:         0.04
3:         0.09
4:         0.05

$DetallSimple[[1]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.07 63.87 -0.91  0.3644      0.13      0.83 0.3622
2:   Sleep on Old  -0.03 43.04 -0.25  0.8032      0.04      0.06 0.7989
3: Age on Control  -0.07 40.45 -0.66  0.5146      0.12      0.43 0.5411
4:      Age on SR  -0.02 44.40 -0.28  0.7831      0.05      0.08 0.7911
5:      YSR vs OC   0.00 35.64  0.03  0.9732      0.05      0.00 0.9756
   EffSize.Boot
1:         0.13
2:         0.05
3:         0.11
4:         0.05
5:         0.04


$DetallSimple[[2]]
$DetallSimple[[2]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 0.25 0.618   0.25  0.618  0.05 0.8190 0.5843        0.620       
2:     Sleep 0.12 0.734   0.12  0.734  0.20 0.6554 0.7529        0.751       
3: Age*Sleep 0.02 0.895   0.02  0.850  0.00 0.9488 0.9583        0.897       
   EffSize
1:    0.06
2:    0.03
3:    0.04

$DetallSimple[[2]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.02 63.84  0.15  0.8788      0.03      0.02 0.8511
2:   Sleep on Old   0.04 37.10  0.32  0.7471      0.06      0.11 0.7578
3: Age on Control  -0.05 45.61 -0.40  0.6876      0.07      0.16 0.6811
4:      Age on SR  -0.03 52.80 -0.30  0.7676      0.05      0.09 0.7878
   EffSize.Boot
1:         0.03
2:         0.07
3:         0.07
4:         0.05

$DetallSimple[[2]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.02 63.84  0.15  0.8788      0.03      0.02 0.8744
2:   Sleep on Old   0.04 37.10  0.32  0.7471      0.06      0.11 0.7578
3: Age on Control  -0.05 45.61 -0.40  0.6876      0.08      0.16 0.6800
4:      Age on SR  -0.03 52.80 -0.30  0.7676      0.05      0.09 0.7611
5:      YSR vs OC  -0.07 42.53 -0.55  0.5874      0.10      0.30 0.5767
   EffSize.Boot
1:         0.03
2:         0.06
3:         0.07
4:         0.05
5:         0.08


$DetallSimple[[3]]
$DetallSimple[[3]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 0.53 0.470   0.53  0.470  0.39 0.5319 0.4658        0.493       
2:     Sleep 0.42 0.519   0.42  0.519  0.62 0.4330 0.5442        0.518       
3: Age*Sleep 1.37 0.245   0.09  0.310  1.10 0.2948 0.2487        0.253       
   EffSize
1:    0.08
2:    0.04
3:    0.16

$DetallSimple[[3]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.04 61.52 -0.36  0.7193      0.06      0.13 0.7078
2:   Sleep on Old   0.13 44.35  1.32  0.1942      0.20      1.74 0.1822
3: Age on Control  -0.14 51.58 -1.36  0.1792      0.20      1.85 0.1956
4:      Age on SR   0.03 52.94  0.31  0.7579      0.05      0.10 0.7556
   EffSize.Boot
1:         0.06
2:         0.20
3:         0.22
4:         0.04

$DetallSimple[[3]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.04 61.52 -0.36  0.7193      0.07      0.13 0.7133
2:   Sleep on Old   0.13 44.35  1.32  0.1942      0.20      1.74 0.1967
3: Age on Control  -0.14 51.58 -1.36  0.1792      0.23      1.85 0.1789
4:      Age on SR   0.03 52.94  0.31  0.7579      0.06      0.10 0.7678
5:      YSR vs OC  -0.10 49.61 -0.93  0.3549      0.15      0.87 0.3522
   EffSize.Boot
1:         0.07
2:         0.21
3:         0.21
4:         0.06
5:         0.14


$DetallSimple[[4]]
$DetallSimple[[4]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 1.56 0.216   1.56  0.216  1.50 0.2225 0.1987        0.211       
2:     Sleep 0.36 0.552   0.36  0.552  0.70 0.4026 0.5860        0.568       
3: Age*Sleep 1.10 0.296   0.09  0.330  0.94 0.3343 0.3489        0.302       
   EffSize
1:    0.13
2:    0.04
3:    0.16

$DetallSimple[[4]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.03 61.43 -0.33  0.7437      0.05      0.11 0.7589
2:   Sleep on Old   0.11 41.58  1.14  0.2613      0.20      1.30 0.2733
3: Age on Control  -0.15 45.95 -1.58  0.1218      0.26      2.48 0.1367
4:      Age on SR  -0.01 52.94 -0.14  0.8866      0.05      0.02 0.8956
   EffSize.Boot
1:         0.06
2:         0.19
3:         0.24
4:         0.05

$DetallSimple[[4]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.03 61.43 -0.33  0.7437      0.05      0.11 0.7300
2:   Sleep on Old   0.11 41.58  1.14  0.2613      0.20      1.30 0.2778
3: Age on Control  -0.15 45.95 -1.58  0.1218      0.23      2.48 0.1022
4:      Age on SR  -0.01 52.94 -0.14  0.8866      0.04      0.02 0.8844
5:      YSR vs OC  -0.12 46.87 -1.21  0.2333      0.21      1.46 0.2433
   EffSize.Boot
1:         0.05
2:         0.19
3:         0.24
4:         0.04
5:         0.19


$DetallSimple[[5]]
$DetallSimple[[5]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 0.11 0.746   0.11  0.746  0.77 0.3814 0.7496        0.768       
2:     Sleep 0.10 0.759   0.10  0.759  0.12 0.7285 0.7546        0.737       
3: Age*Sleep 0.03 0.856  -0.04  0.680  0.17 0.6835 0.9316        0.841       
   EffSize
1:    0.06
2:    0.03
3:    0.08

$DetallSimple[[5]]$Detall
            Contr psihat    df test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.03 61.21 0.38  0.7053      0.06      0.14 0.7344
2:   Sleep on Old   0.01 43.45 0.08  0.9346      0.05      0.01 0.9356
3: Age on Control   0.03 50.16 0.40  0.6896      0.08      0.16 0.7022
4:      Age on SR   0.01 48.24 0.09  0.9268      0.03      0.01 0.9300
   EffSize.Boot
1:         0.05
2:         0.03
3:         0.08
4:         0.03

$DetallSimple[[5]]$DetallExt
            Contr psihat    df test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.03 61.21 0.38  0.7053      0.05      0.14 0.6989
2:   Sleep on Old   0.01 43.45 0.08  0.9346      0.04      0.01 0.9400
3: Age on Control   0.03 50.16 0.40  0.6896      0.08      0.16 0.7044
4:      Age on SR   0.01 48.24 0.09  0.9268      0.04      0.01 0.9278
5:      YSR vs OC   0.00 49.26 0.01  0.9898      0.05      0.00 0.9967
   EffSize.Boot
1:         0.05
2:         0.03
3:         0.07
4:         0.03
5:         0.05
Omnibus AOV. Design 2x2x(5xS)
Names Q p pBoot Sig pBootMas Sig2
Age 0.11 0.7436 0.7863 0.7512
Sleep 0.23 0.6290 0.6427 0.6262
Time 0.03 0.9983 0.9900 0.9902
Age*Sleep 2.85 0.0914 0.1052 0.0000
Age*Time 0.13 0.9728 0.8164 0.8508
Sleep*Time 0.33 0.8592 0.4157 0.5038
AgeSleepTime 0.17 0.9535 0.7095 0.7775
Interaction Age-Sleep. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1
Sleep on Young 0.58 310.01 1.68 0.0934 0.26
Sleep on Old -0.42 219.08 -1.00 0.3175 0.15
Age on Control 0.50 222.29 1.32 0.1879 0.22
Age on SR -0.50 246.57 -1.29 0.1984 0.30
Interaction Age-Time. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1
Age on M1 -0.02 93.70 -0.07 0.9448 0.04
Age on M2 0.02 94.20 0.09 0.9263 0.04
Age on M3 -0.04 87.95 -0.16 0.8699 0.04
Age on M4 0.21 97.98 0.89 0.3768 0.08
Age on M5 -0.17 95.24 -0.70 0.4885 0.08
M1-M2 on Young 0.00 NA 0.00 1.0000 0.01
M1-M2 on Old 0.23 NA 1.01 0.3218 0.02
M2-M3 on Young -0.27 NA -1.20 0.2443 0.04
M2-M3 on Old -0.05 NA -0.19 0.8507 0.02
M3-M4 on Young 0.18 NA 0.83 0.4176 0.03
M3-M4 on Old 0.14 NA 0.55 0.5874 0.08
M4-M5 on Young 0.00 NA 0.00 1.0000 0.03
M4-M5 on Old -0.32 NA -1.45 0.1630 0.14
Interaction Sleep-Time. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1
Sleep on M1 0.40 93.70 1.65 0.1021 0.20
Sleep on M2 -0.19 94.20 -0.77 0.4416 0.07
Sleep on M3 0.18 87.95 0.74 0.4613 0.12
Sleep on M4 -0.18 97.98 -0.78 0.4400 0.07
Sleep on M5 -0.04 95.24 -0.17 0.8628 0.03
M1-M2 on Young 0.50 NA 1.44 0.1638 0.14
M1-M2 on Old -0.09 NA -0.39 0.7000 0.12
M2-M3 on Young -0.41 NA -1.29 0.2098 0.06
M2-M3 on Old 0.18 NA 0.83 0.4176 0.14
M3-M4 on Young 0.27 NA 1.97 0.0625 0.10
M3-M4 on Old -0.14 NA -0.53 0.6016 0.09
M4-M5 on Young -0.18 NA -0.87 0.3927 0.05
M4-M5 on Old 0.00 NA 0.00 1.0000 0.02
Main Effect Time. Design 2x2x(5xS)
Contr psihat test p.value Psihat2 p.value2 EfSize.V1
M1-M2 0.55 1.51 0.1451 0.05 0.820 0.02
M2-M3 -0.05 -0.10 0.9191 0.12 0.720 0.03
M3-M4 0.27 0.78 0.4458 0.06 0.876 0.01
M4-M5 -0.27 -1.14 0.2653 -0.23 0.404 0.03
Simple Effect Time each Age-Sleep condition. Design 2x2x(5xS)
Contr psihat df test p.value Psihat2 p.value2 dif.yuen df.yuen test.yuen EffSize.yuen pvaluet.yuen
M1-M2 on Y_C 0.18 NA 0.79 0.4398 0.14 0.360 0.14 35 0.89 0.13 0.3787
M1-M2 on Y_SR -0.05 NA -0.39 0.7023 -0.13 0.394 -0.13 29 -0.89 0.13 0.3826
M1-M2 on O_C 0.23 NA 1.67 0.1089 0.18 0.272 0.18 21 1.06 0.17 0.3005
M1-M2 on O_SR -0.14 NA -1.07 0.2988 -0.14 0.386 -0.17 23 -0.93 0.11 0.3603
M2-M3 on Y_C -0.45 NA -3.14 0.0050 -0.11 0.492 -0.11 35 -0.81 0.10 0.4236
M2-M3 on Y_SR 0.14 NA 1.07 0.2988 0.20 0.124 0.23 30 1.62 0.22 0.1150
M2-M3 on O_C -0.05 NA -0.24 0.8156 -0.01 0.886 -0.05 20 -0.27 0.00 0.7892
M2-M3 on O_SR -0.05 NA -0.21 0.8359 0.04 0.844 0.00 24 0.00 0.04 1.0000
M3-M4 on Y_C 0.27 NA 1.97 0.0625 0.11 0.412 0.11 35 0.94 0.10 0.3553
M3-M4 on Y_SR -0.09 NA -0.74 0.4683 -0.20 0.134 -0.17 28 -1.21 0.19 0.2361
M3-M4 on O_C 0.05 NA 0.39 0.7023 0.10 0.510 0.10 20 0.57 0.09 0.5776
M3-M4 on O_SR 0.09 NA 0.36 0.7231 0.05 0.752 0.04 23 0.24 0.04 0.8143
M4-M5 on Y_C 0.18 NA 0.87 0.3927 0.04 0.790 0.03 33 0.20 0.03 0.8450
M4-M5 on Y_SR 0.00 NA 0.00 1.0000 0.03 0.906 0.00 29 0.00 0.03 1.0000
M4-M5 on O_C -0.18 NA -1.38 0.1835 -0.23 0.228 -0.18 21 -1.15 0.17 0.2627
M4-M5 on O_SR -0.05 NA -0.21 0.8359 -0.08 0.644 -0.08 24 -0.44 0.07 0.6644
Simple Effect Age-Sleep on Time=1 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.46 0.500 0.46 0.500 0.20 0.6559 0.4891 0.527 0.08
Sleep 0.53 0.469 0.53 0.469 0.58 0.4490 0.4841 0.470 0.10
Age*Sleep 0.10 0.753 0.04 0.630 0.14 0.7111 0.8364 0.759 0.04
Simple Effect Age-Sleep on Time=1 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.07 63.87 -0.91 0.3644 0.12 0.83 0.3389 0.11
Sleep on Old -0.03 43.04 -0.25 0.8032 0.05 0.06 0.8067 0.04
Age on Control -0.07 40.45 -0.66 0.5146 0.11 0.43 0.5333 0.09
Age on SR -0.02 44.40 -0.28 0.7831 0.04 0.08 0.8033 0.05
Simple Effect Age-Sleep on Time=1 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.07 63.87 -0.91 0.3644 0.13 0.83 0.3622 0.13
Sleep on Old -0.03 43.04 -0.25 0.8032 0.04 0.06 0.7989 0.05
Age on Control -0.07 40.45 -0.66 0.5146 0.12 0.43 0.5411 0.11
Age on SR -0.02 44.40 -0.28 0.7831 0.05 0.08 0.7911 0.05
YSR vs OC 0.00 35.64 0.03 0.9732 0.05 0.00 0.9756 0.04
Simple Effect Age-Sleep on Time=2 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.25 0.618 0.25 0.618 0.05 0.8190 0.5843 0.620 0.06
Sleep 0.12 0.734 0.12 0.734 0.20 0.6554 0.7529 0.751 0.03
Age*Sleep 0.02 0.895 0.02 0.850 0.00 0.9488 0.9583 0.897 0.04
Simple Effect Age-Sleep on Time=2 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.02 63.84 0.15 0.8788 0.03 0.02 0.8511 0.03
Sleep on Old 0.04 37.10 0.32 0.7471 0.06 0.11 0.7578 0.07
Age on Control -0.05 45.61 -0.40 0.6876 0.07 0.16 0.6811 0.07
Age on SR -0.03 52.80 -0.30 0.7676 0.05 0.09 0.7878 0.05
Simple Effect Age-Sleep on Time=2 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.02 63.84 0.15 0.8788 0.03 0.02 0.8744 0.03
Sleep on Old 0.04 37.10 0.32 0.7471 0.06 0.11 0.7578 0.06
Age on Control -0.05 45.61 -0.40 0.6876 0.08 0.16 0.6800 0.07
Age on SR -0.03 52.80 -0.30 0.7676 0.05 0.09 0.7611 0.05
YSR vs OC -0.07 42.53 -0.55 0.5874 0.10 0.30 0.5767 0.08
Simple Effect Age-Sleep on Time=3 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.53 0.470 0.53 0.470 0.39 0.5319 0.4658 0.493 0.08
Sleep 0.42 0.519 0.42 0.519 0.62 0.4330 0.5442 0.518 0.04
Age*Sleep 1.37 0.245 0.09 0.310 1.10 0.2948 0.2487 0.253 0.16
Simple Effect Age-Sleep on Time=3 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.04 61.52 -0.36 0.7193 0.06 0.13 0.7078 0.06
Sleep on Old 0.13 44.35 1.32 0.1942 0.20 1.74 0.1822 0.20
Age on Control -0.14 51.58 -1.36 0.1792 0.20 1.85 0.1956 0.22
Age on SR 0.03 52.94 0.31 0.7579 0.05 0.10 0.7556 0.04
Simple Effect Age-Sleep on Time=3 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.04 61.52 -0.36 0.7193 0.07 0.13 0.7133 0.07
Sleep on Old 0.13 44.35 1.32 0.1942 0.20 1.74 0.1967 0.21
Age on Control -0.14 51.58 -1.36 0.1792 0.23 1.85 0.1789 0.21
Age on SR 0.03 52.94 0.31 0.7579 0.06 0.10 0.7678 0.06
YSR vs OC -0.10 49.61 -0.93 0.3549 0.15 0.87 0.3522 0.14
Simple Effect Age-Sleep on Time=4 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 1.56 0.216 1.56 0.216 1.50 0.2225 0.1987 0.211 0.13
Sleep 0.36 0.552 0.36 0.552 0.70 0.4026 0.5860 0.568 0.04
Age*Sleep 1.10 0.296 0.09 0.330 0.94 0.3343 0.3489 0.302 0.16
Simple Effect Age-Sleep on Time=4 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.03 61.43 -0.33 0.7437 0.05 0.11 0.7589 0.06
Sleep on Old 0.11 41.58 1.14 0.2613 0.20 1.30 0.2733 0.19
Age on Control -0.15 45.95 -1.58 0.1218 0.26 2.48 0.1367 0.24
Age on SR -0.01 52.94 -0.14 0.8866 0.05 0.02 0.8956 0.05
Simple Effect Age-Sleep on Time=4 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.03 61.43 -0.33 0.7437 0.05 0.11 0.7300 0.05
Sleep on Old 0.11 41.58 1.14 0.2613 0.20 1.30 0.2778 0.19
Age on Control -0.15 45.95 -1.58 0.1218 0.23 2.48 0.1022 0.24
Age on SR -0.01 52.94 -0.14 0.8866 0.04 0.02 0.8844 0.04
YSR vs OC -0.12 46.87 -1.21 0.2333 0.21 1.46 0.2433 0.19
Simple Effect Age-Sleep on Time=5 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.11 0.746 0.11 0.746 0.77 0.3814 0.7496 0.768 0.06
Sleep 0.10 0.759 0.10 0.759 0.12 0.7285 0.7546 0.737 0.03
Age*Sleep 0.03 0.856 -0.04 0.680 0.17 0.6835 0.9316 0.841 0.08
Simple Effect Age-Sleep on Time=5 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.03 61.21 0.38 0.7053 0.06 0.14 0.7344 0.05
Sleep on Old 0.01 43.45 0.08 0.9346 0.05 0.01 0.9356 0.03
Age on Control 0.03 50.16 0.40 0.6896 0.08 0.16 0.7022 0.08
Age on SR 0.01 48.24 0.09 0.9268 0.03 0.01 0.9300 0.03
Simple Effect Age-Sleep on Time=5 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.03 61.21 0.38 0.7053 0.05 0.14 0.6989 0.05
Sleep on Old 0.01 43.45 0.08 0.9346 0.04 0.01 0.9400 0.03
Age on Control 0.03 50.16 0.40 0.6896 0.08 0.16 0.7044 0.07
Age on SR 0.01 48.24 0.09 0.9268 0.04 0.01 0.9278 0.03
YSR vs OC 0.00 49.26 0.01 0.9898 0.05 0.00 0.9967 0.05

10.5 Fig S1F Field size {Design 2x2x(5xS)}

  NmBas="FigS1F FieldSize"
  NmFAlL<-paste0(PathDesign,NmBas)
  if (!dir.exists(NmFAlL)) {dir.create(NmFAlL)}
  NmFAlL<-paste0(NmFAlL,"/")
  ResGen<-NA

  rrt<-ExDataIS.2(nmF = paste0(PathDesign,"Parameters.csv"),Vars = c(1,5,6,36:40),vIntP =c(4:8),lvlCh = list("HAB"="SmFields_s1", "T1"="SmFields_s2","T2"="SmFields_s3","T3"="SmFields_s4","Test"="SmFields_s5"))
  DatDT<-rrt$DT
  ArP<-rrt$Arp
  ExtendDT<-rrt$ExtendDT
  
  # Simple Effects:
  DatEfS<-list()
  for(is in 1:5) {
    DatEfS[[is]]<-ExData.2(nmF = paste0(PathDesign,"Parameters.csv"),Vars = c(5:6,(6+is)))
    names(DatEfS[[is]]$DT)[3]<-"DepV"
  }
  
  # Graphs
  Grp<- Grph.3(DatP = ExtendDT,"OPR",LblsP =c("Object Exploration", "",bquote('Field Size (cm'~(cm^2))),ylmP =c(0,600),hLin = F,lvIp=5)
  Grp2=Grp
    
    #AOV
    #A=2;B=2;C=5;DatPas=rrt;DatEfSp=DatEfS;nBMM1=nBMM2=1000;Prc=2
    names(rrt$DT)[4:8]<-c("T1","T2","T3","T4","T5")
    ResGen<-AOVMx2.5(A=2,B=2,C=5,DatPas = rrt,DatEfSp = DatEfS,nBMM1 = 1000,nBMM2 = 1000,Prc = 2)
    AlmacenGen2(GrpP = Grp,Grp2P = Grp2,DataPas = ResGen,PathDesignP = PathDesign,NmBasP = NmBas,Typ=2)
  
  # Other Graphs
    GrpO<-Grph.3.Otros(ExtendDT,LblsP =c("Object Exploration", "F",bquote('Field Size (cm'~(cm^2))))
    
    ExtendDTCol<-copy(ExtendDT)
    ExtendDTCol$Moment<-"All"
    ExtendDTCol<-data.table(rbind(ExtendDT,ExtendDTCol))
    
    Grp3<-Grph.3(DatP = ExtendDTCol,"OPR",LblsP =c("Object Exploration", "F",bquote('Field Size (cm'~(cm^2))),ylmP =c(0,600),hLin = F,lvIp = 6,wMain = T)
   
    pdf(paste0(NmFAlL,NmBas,"OtrosGraphs.pdf"))
      Grp3
      GrpO
    dev.off()
    
    # Results
        # Results
        plot(Grp)
        plot(Grp2) # Only this graph is printed in the html file.
        GrpO
        plot(Grp3)
        ResGen # Lean option to view the results of statistical analysis
        
        Kbl3(ResPas = ResGen[[1]], lbl = "Omnibus AOV. Design 2x2x(5xS)");cat("\n")
        Kbl3(ResGen[[2]], "Interaction Age-Sleep. Design 2x2x(5xS)")
        Kbl3(ResGen[[3]], "Interaction Age-Time. Design 2x2x(5xS)")
        Kbl3(ResGen[[4]], "Interaction Sleep-Time. Design 2x2x(5xS)")
        Kbl3(ResGen[[5]], "Main Effect Time. Design 2x2x(5xS)")
        Kbl3(ResGen[[6]], "Simple Effect Time each Age-Sleep condition. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[1]][[1]], "Simple Effect Age-Sleep on Time=1 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[1]][[2]], "Simple Effect Age-Sleep on Time=1 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[1]][[3]], "Simple Effect Age-Sleep on Time=1 Extense Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[2]][[1]], "Simple Effect Age-Sleep on Time=2 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[2]][[2]], "Simple Effect Age-Sleep on Time=2 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[2]][[3]], "Simple Effect Age-Sleep on Time=2 Extense Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[3]][[1]], "Simple Effect Age-Sleep on Time=3 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[3]][[2]], "Simple Effect Age-Sleep on Time=3 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[3]][[3]], "Simple Effect Age-Sleep on Time=3 Extense Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[4]][[1]], "Simple Effect Age-Sleep on Time=4 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[4]][[2]], "Simple Effect Age-Sleep on Time=4 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[4]][[3]], "Simple Effect Age-Sleep on Time=4 Extense Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[5]][[1]], "Simple Effect Age-Sleep on Time=5 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[5]][[2]], "Simple Effect Age-Sleep on Time=5 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[5]][[3]], "Simple Effect Age-Sleep on Time=5 Extense Simple Effects. Design 2x2x(5xS)")
           Eff   p.V1 p.Sig
1:   p.value.A 0.8731      
2:   p.value.B 0.8548      
3:   p.value.C 0.0684      
4:  p.value.AB 0.6327      
5:  p.value.AC 0.9883      
6:  p.value.BC 0.1536      
7: p.value.ABC 0.1119      
           Eff   p.V1 p.Sig
1:   p.value.A 0.8708      
2:   p.value.B 0.8368      
3:   p.value.C 0.1268      
4:  p.value.AB 0.7002      
5:  p.value.AC 0.9845      
6:  p.value.BC 0.2330      
7: p.value.ABC 0.1835      
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
$BP

$Bars

$MargAB

$MargAC

$MargBC

$MargC

quartz_off_screen 
                2 
$BP

$Bars

$MargAB

$MargAC

$MargBC

$MargC

$AOV
            Names    Q      p  pBoot Sig pBootMas Sig2
1:            Age 0.03 0.8687 0.8731       0.8708     
2:          Sleep 0.04 0.8429 0.8548       0.8368     
3:           Time 0.78 0.5373 0.0684       0.1268     
4:      Age*Sleep 0.22 0.6354 0.6327       0.7002     
5:       Age*Time 0.04 0.9973 0.9883       0.9845     
6:     Sleep*Time 0.59 0.6668 0.1536       0.2330     
7: Age*Sleep*Time 0.67 0.6095 0.1119       0.1835     

$InterAB
            Contr psihat     df  test p.value EfSize.V1
1: Sleep on Young  45.84 271.29  0.66  0.5115      0.03
2:   Sleep on Old -28.69 203.91 -0.47  0.6406      0.03
3: Age on Control  30.93 255.45  0.49  0.6221      0.11
4:      Age on SR -43.60 229.38 -0.64  0.5254      0.05

$InterAC
             Contr psihat     df  test p.value EfSize.V1
 1:      Age on M1 -18.70  94.73 -0.41  0.6857      0.05
 2:      Age on M2 -12.82 101.14 -0.33  0.7456      0.04
 3:      Age on M3  -5.11 107.60 -0.15  0.8840      0.05
 4:      Age on M4  12.51 103.87  0.28  0.7818      0.05
 5:      Age on M5  11.45  91.08  0.28  0.7818      0.03
 6: M1-M2 on Young  23.62     NA  0.61  0.5492      0.10
 7:   M1-M2 on Old  63.81     NA  1.98  0.0622      0.13
 8: M2-M3 on Young  20.38     NA  0.69  0.5005      0.08
 9:   M2-M3 on Old  40.19     NA  1.47  0.1584      0.13
10: M3-M4 on Young -20.38     NA -0.82  0.4209      0.10
11:   M3-M4 on Old  -0.57     NA -0.02  0.9809      0.09
12: M4-M5 on Young   2.10     NA  0.07  0.9477      0.05
13:   M4-M5 on Old  17.52     NA  0.48  0.6356      0.07

$InterBC
             Contr psihat     df  test p.value EfSize.V1
 1:    Sleep on M1  30.80  94.73  0.67  0.5054      0.09
 2:    Sleep on M2 -41.98 101.14 -1.07  0.2891      0.10
 3:    Sleep on M3  33.90 107.60  0.97  0.3347      0.10
 4:    Sleep on M4 -38.08 103.87 -0.85  0.4000      0.09
 5:    Sleep on M5  32.52  91.08  0.79  0.4323      0.06
 6: M1-M2 on Young  66.67     NA  1.89  0.0739      0.21
 7:   M1-M2 on Old  16.19     NA  0.51  0.6141      0.02
 8: M2-M3 on Young   4.19     NA  0.12  0.9083      0.01
 9:   M2-M3 on Old  56.00     NA  1.65  0.1136      0.20
10: M3-M4 on Young -12.38     NA -0.43  0.6720      0.01
11:   M3-M4 on Old -18.10     NA -0.85  0.4064      0.19
12: M4-M5 on Young  22.29     NA  0.74  0.4682      0.03
13:   M4-M5 on Old   3.24     NA  0.10  0.9252      0.13

$DetallMainC
   Contr psihat  test p.value Psihat2 p.value2 EfSize.V1
1: M1-M2  99.62  1.95  0.0647   81.00    0.096      0.11
2: M2-M3  91.24  2.12  0.0464   64.82    0.188      0.10
3: M3-M4 -31.81 -0.83  0.4150  -70.10    0.056      0.09
4: M4-M5   0.38  0.01  0.9926   42.09    0.348      0.05

$DetallTrialCadaCondAB
            Contr psihat df  test p.value Psihat2 p.value2 dif.yuen df.yuen
 1:  M1-M2 on Y_C  27.05 NA  0.95  0.3559   34.89    0.216    34.89      35
 2: M1-M2 on Y_SR  -7.81 NA -0.48  0.6378    2.67    0.942     2.67      29
 3:  M1-M2 on O_C  36.76 NA  1.92  0.0695   42.00    0.036    42.00      21
 4: M1-M2 on O_SR  14.29 NA  0.88  0.3883    1.44    0.922     1.44      24
 5:  M2-M3 on Y_C  -5.33 NA -0.35  0.7323    1.89    0.878     1.89      35
 6: M2-M3 on Y_SR  38.29 NA  1.79  0.0894   26.67    0.218    26.67      29
 7:  M2-M3 on O_C   1.33 NA  0.06  0.9563   -7.42    0.708    -3.62      20
 8: M2-M3 on O_SR  31.81 NA  1.53  0.1426   43.68    0.016    43.68      24
 9:  M3-M4 on Y_C  -5.71 NA -0.35  0.7298    7.33    0.686     7.33      35
10: M3-M4 on Y_SR -14.86 NA -1.07  0.2953  -51.20    0.000   -51.20      29
11:  M3-M4 on O_C   2.86 NA  0.12  0.9024   -6.40    0.846   -10.29      20
12: M3-M4 on O_SR  -6.48 NA -0.40  0.6914  -19.84    0.396   -19.84      24
13:  M4-M5 on Y_C  27.81 NA  2.09  0.0493    4.11    0.902     4.11      35
14: M4-M5 on Y_SR -22.67 NA -1.09  0.2888   17.47    0.540    17.47      29
15:  M4-M5 on O_C  -8.95 NA -0.40  0.6950  -18.36    0.458   -18.36      21
16: M4-M5 on O_SR  21.52 NA  0.92  0.3680   38.88    0.164    38.88      24
    test.yuen EffSize.yuen pvaluet.yuen
 1:      1.30         0.17       0.2035
 2:      0.11         0.01       0.9154
 3:      1.97         0.26       0.0627
 4:      0.07         0.01       0.9484
 5:      0.09         0.01       0.9304
 6:      1.17         0.16       0.2507
 7:     -0.19         0.05       0.8519
 8:      2.19         0.25       0.0388
 9:      0.37         0.03       0.7147
10:     -2.62         0.28       0.0140
11:     -0.46         0.06       0.6470
12:     -0.93         0.12       0.3637
13:      0.19         0.02       0.8513
14:      0.56         0.07       0.5780
15:     -0.71         0.11       0.4864
16:      1.65         0.22       0.1128

$DetallSimple
$DetallSimple[[1]]
$DetallSimple[[1]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 0.46 0.500   0.46  0.500  0.20 0.6559 0.4891        0.498       
2:     Sleep 0.53 0.469   0.53  0.469  0.58 0.4490 0.4841        0.436       
3: Age*Sleep 0.10 0.753   0.04  0.630  0.14 0.7111 0.8364        0.729       
   EffSize
1:    0.08
2:    0.10
3:    0.04

$DetallSimple[[1]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.07 63.87 -0.91  0.3644      0.12      0.83 0.3656
2:   Sleep on Old  -0.03 43.04 -0.25  0.8032      0.04      0.06 0.7856
3: Age on Control  -0.07 40.45 -0.66  0.5146      0.12      0.43 0.5311
4:      Age on SR  -0.02 44.40 -0.28  0.7831      0.05      0.08 0.7844
   EffSize.Boot
1:         0.11
2:         0.04
3:         0.11
4:         0.04

$DetallSimple[[1]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.07 63.87 -0.91  0.3644      0.12      0.83 0.3311
2:   Sleep on Old  -0.03 43.04 -0.25  0.8032      0.05      0.06 0.8022
3: Age on Control  -0.07 40.45 -0.66  0.5146      0.09      0.43 0.5089
4:      Age on SR  -0.02 44.40 -0.28  0.7831      0.05      0.08 0.8056
5:      YSR vs OC   0.00 35.64  0.03  0.9732      0.05      0.00 0.9756
   EffSize.Boot
1:         0.14
2:         0.04
3:         0.12
4:         0.04
5:         0.04


$DetallSimple[[2]]
$DetallSimple[[2]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 0.25 0.618   0.25  0.618  0.05 0.8190 0.5843        0.627       
2:     Sleep 0.12 0.734   0.12  0.734  0.20 0.6554 0.7529        0.729       
3: Age*Sleep 0.02 0.895   0.02  0.850  0.00 0.9488 0.9583        0.889       
   EffSize
1:    0.06
2:    0.03
3:    0.04

$DetallSimple[[2]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.02 63.84  0.15  0.8788      0.03      0.02 0.8878
2:   Sleep on Old   0.04 37.10  0.32  0.7471      0.06      0.11 0.7456
3: Age on Control  -0.05 45.61 -0.40  0.6876      0.07      0.16 0.6744
4:      Age on SR  -0.03 52.80 -0.30  0.7676      0.05      0.09 0.7556
   EffSize.Boot
1:         0.03
2:         0.06
3:         0.06
4:         0.05

$DetallSimple[[2]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.02 63.84  0.15  0.8788      0.03      0.02 0.8756
2:   Sleep on Old   0.04 37.10  0.32  0.7471      0.06      0.11 0.7467
3: Age on Control  -0.05 45.61 -0.40  0.6876      0.07      0.16 0.6889
4:      Age on SR  -0.03 52.80 -0.30  0.7676      0.05      0.09 0.7667
5:      YSR vs OC  -0.07 42.53 -0.55  0.5874      0.10      0.30 0.5767
   EffSize.Boot
1:         0.04
2:         0.06
3:         0.07
4:         0.06
5:         0.08


$DetallSimple[[3]]
$DetallSimple[[3]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 0.53 0.470   0.53  0.470  0.39 0.5319 0.4658        0.462       
2:     Sleep 0.42 0.519   0.42  0.519  0.62 0.4330 0.5442        0.499       
3: Age*Sleep 1.37 0.245   0.09  0.310  1.10 0.2948 0.2487        0.237       
   EffSize
1:    0.08
2:    0.04
3:    0.16

$DetallSimple[[3]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.04 61.52 -0.36  0.7193      0.06      0.13 0.7222
2:   Sleep on Old   0.13 44.35  1.32  0.1942      0.21      1.74 0.1600
3: Age on Control  -0.14 51.58 -1.36  0.1792      0.23      1.85 0.1744
4:      Age on SR   0.03 52.94  0.31  0.7579      0.06      0.10 0.7733
   EffSize.Boot
1:         0.07
2:         0.21
3:         0.21
4:         0.05

$DetallSimple[[3]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.04 61.52 -0.36  0.7193      0.06      0.13 0.7011
2:   Sleep on Old   0.13 44.35  1.32  0.1942      0.21      1.74 0.2000
3: Age on Control  -0.14 51.58 -1.36  0.1792      0.22      1.85 0.1578
4:      Age on SR   0.03 52.94  0.31  0.7579      0.06      0.10 0.7567
5:      YSR vs OC  -0.10 49.61 -0.93  0.3549      0.15      0.87 0.3522
   EffSize.Boot
1:         0.06
2:         0.20
3:         0.20
4:         0.05
5:         0.14


$DetallSimple[[4]]
$DetallSimple[[4]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 1.56 0.216   1.56  0.216  1.50 0.2225 0.1987        0.222       
2:     Sleep 0.36 0.552   0.36  0.552  0.70 0.4026 0.5860        0.558       
3: Age*Sleep 1.10 0.296   0.09  0.330  0.94 0.3343 0.3489        0.301       
   EffSize
1:    0.13
2:    0.04
3:    0.16

$DetallSimple[[4]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.03 61.43 -0.33  0.7437      0.05      0.11 0.7511
2:   Sleep on Old   0.11 41.58  1.14  0.2613      0.20      1.30 0.2656
3: Age on Control  -0.15 45.95 -1.58  0.1218      0.24      2.48 0.1311
4:      Age on SR  -0.01 52.94 -0.14  0.8866      0.04      0.02 0.9067
   EffSize.Boot
1:         0.04
2:         0.19
3:         0.22
4:         0.05

$DetallSimple[[4]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.03 61.43 -0.33  0.7437      0.05      0.11 0.7400
2:   Sleep on Old   0.11 41.58  1.14  0.2613      0.20      1.30 0.2522
3: Age on Control  -0.15 45.95 -1.58  0.1218      0.23      2.48 0.1411
4:      Age on SR  -0.01 52.94 -0.14  0.8866      0.04      0.02 0.8933
5:      YSR vs OC  -0.12 46.87 -1.21  0.2333      0.21      1.46 0.2433
   EffSize.Boot
1:         0.05
2:         0.19
3:         0.25
4:         0.04
5:         0.19


$DetallSimple[[5]]
$DetallSimple[[5]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 0.11 0.746   0.11  0.746  0.77 0.3814 0.7496        0.752       
2:     Sleep 0.10 0.759   0.10  0.759  0.12 0.7285 0.7546        0.755       
3: Age*Sleep 0.03 0.856  -0.04  0.680  0.17 0.6835 0.9316        0.875       
   EffSize
1:    0.06
2:    0.03
3:    0.08

$DetallSimple[[5]]$Detall
            Contr psihat    df test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.03 61.21 0.38  0.7053      0.06      0.14 0.7122
2:   Sleep on Old   0.01 43.45 0.08  0.9346      0.04      0.01 0.9400
3: Age on Control   0.03 50.16 0.40  0.6896      0.10      0.16 0.6900
4:      Age on SR   0.01 48.24 0.09  0.9268      0.03      0.01 0.9278
   EffSize.Boot
1:         0.07
2:         0.03
3:         0.09
4:         0.03

$DetallSimple[[5]]$DetallExt
            Contr psihat    df test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.03 61.21 0.38  0.7053      0.05      0.14 0.6989
2:   Sleep on Old   0.01 43.45 0.08  0.9346      0.04      0.01 0.9367
3: Age on Control   0.03 50.16 0.40  0.6896      0.10      0.16 0.6844
4:      Age on SR   0.01 48.24 0.09  0.9268      0.04      0.01 0.9278
5:      YSR vs OC   0.00 49.26 0.01  0.9898      0.05      0.00 0.9967
   EffSize.Boot
1:         0.06
2:         0.03
3:         0.08
4:         0.03
5:         0.05
Omnibus AOV. Design 2x2x(5xS)
Names Q p pBoot Sig pBootMas Sig2
Age 0.03 0.8687 0.8731 0.8708
Sleep 0.04 0.8429 0.8548 0.8368
Time 0.78 0.5373 0.0684 0.1268
Age*Sleep 0.22 0.6354 0.6327 0.7002
Age*Time 0.04 0.9973 0.9883 0.9845
Sleep*Time 0.59 0.6668 0.1536 0.2330
AgeSleepTime 0.67 0.6095 0.1119 0.1835
Interaction Age-Sleep. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1
Sleep on Young 45.84 271.29 0.66 0.5115 0.03
Sleep on Old -28.69 203.91 -0.47 0.6406 0.03
Age on Control 30.93 255.45 0.49 0.6221 0.11
Age on SR -43.60 229.38 -0.64 0.5254 0.05
Interaction Age-Time. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1
Age on M1 -18.70 94.73 -0.41 0.6857 0.05
Age on M2 -12.82 101.14 -0.33 0.7456 0.04
Age on M3 -5.11 107.60 -0.15 0.8840 0.05
Age on M4 12.51 103.87 0.28 0.7818 0.05
Age on M5 11.45 91.08 0.28 0.7818 0.03
M1-M2 on Young 23.62 NA 0.61 0.5492 0.10
M1-M2 on Old 63.81 NA 1.98 0.0622 0.13
M2-M3 on Young 20.38 NA 0.69 0.5005 0.08
M2-M3 on Old 40.19 NA 1.47 0.1584 0.13
M3-M4 on Young -20.38 NA -0.82 0.4209 0.10
M3-M4 on Old -0.57 NA -0.02 0.9809 0.09
M4-M5 on Young 2.10 NA 0.07 0.9477 0.05
M4-M5 on Old 17.52 NA 0.48 0.6356 0.07
Interaction Sleep-Time. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1
Sleep on M1 30.80 94.73 0.67 0.5054 0.09
Sleep on M2 -41.98 101.14 -1.07 0.2891 0.10
Sleep on M3 33.90 107.60 0.97 0.3347 0.10
Sleep on M4 -38.08 103.87 -0.85 0.4000 0.09
Sleep on M5 32.52 91.08 0.79 0.4323 0.06
M1-M2 on Young 66.67 NA 1.89 0.0739 0.21
M1-M2 on Old 16.19 NA 0.51 0.6141 0.02
M2-M3 on Young 4.19 NA 0.12 0.9083 0.01
M2-M3 on Old 56.00 NA 1.65 0.1136 0.20
M3-M4 on Young -12.38 NA -0.43 0.6720 0.01
M3-M4 on Old -18.10 NA -0.85 0.4064 0.19
M4-M5 on Young 22.29 NA 0.74 0.4682 0.03
M4-M5 on Old 3.24 NA 0.10 0.9252 0.13
Main Effect Time. Design 2x2x(5xS)
Contr psihat test p.value Psihat2 p.value2 EfSize.V1
M1-M2 99.62 1.95 0.0647 81.00 0.096 0.11
M2-M3 91.24 2.12 0.0464 64.82 0.188 0.10
M3-M4 -31.81 -0.83 0.4150 -70.10 0.056 0.09
M4-M5 0.38 0.01 0.9926 42.09 0.348 0.05
Simple Effect Time each Age-Sleep condition. Design 2x2x(5xS)
Contr psihat df test p.value Psihat2 p.value2 dif.yuen df.yuen test.yuen EffSize.yuen pvaluet.yuen
M1-M2 on Y_C 27.05 NA 0.95 0.3559 34.89 0.216 34.89 35 1.30 0.17 0.2035
M1-M2 on Y_SR -7.81 NA -0.48 0.6378 2.67 0.942 2.67 29 0.11 0.01 0.9154
M1-M2 on O_C 36.76 NA 1.92 0.0695 42.00 0.036 42.00 21 1.97 0.26 0.0627
M1-M2 on O_SR 14.29 NA 0.88 0.3883 1.44 0.922 1.44 24 0.07 0.01 0.9484
M2-M3 on Y_C -5.33 NA -0.35 0.7323 1.89 0.878 1.89 35 0.09 0.01 0.9304
M2-M3 on Y_SR 38.29 NA 1.79 0.0894 26.67 0.218 26.67 29 1.17 0.16 0.2507
M2-M3 on O_C 1.33 NA 0.06 0.9563 -7.42 0.708 -3.62 20 -0.19 0.05 0.8519
M2-M3 on O_SR 31.81 NA 1.53 0.1426 43.68 0.016 43.68 24 2.19 0.25 0.0388
M3-M4 on Y_C -5.71 NA -0.35 0.7298 7.33 0.686 7.33 35 0.37 0.03 0.7147
M3-M4 on Y_SR -14.86 NA -1.07 0.2953 -51.20 0.000 -51.20 29 -2.62 0.28 0.0140
M3-M4 on O_C 2.86 NA 0.12 0.9024 -6.40 0.846 -10.29 20 -0.46 0.06 0.6470
M3-M4 on O_SR -6.48 NA -0.40 0.6914 -19.84 0.396 -19.84 24 -0.93 0.12 0.3637
M4-M5 on Y_C 27.81 NA 2.09 0.0493 4.11 0.902 4.11 35 0.19 0.02 0.8513
M4-M5 on Y_SR -22.67 NA -1.09 0.2888 17.47 0.540 17.47 29 0.56 0.07 0.5780
M4-M5 on O_C -8.95 NA -0.40 0.6950 -18.36 0.458 -18.36 21 -0.71 0.11 0.4864
M4-M5 on O_SR 21.52 NA 0.92 0.3680 38.88 0.164 38.88 24 1.65 0.22 0.1128
Simple Effect Age-Sleep on Time=1 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.46 0.500 0.46 0.500 0.20 0.6559 0.4891 0.498 0.08
Sleep 0.53 0.469 0.53 0.469 0.58 0.4490 0.4841 0.436 0.10
Age*Sleep 0.10 0.753 0.04 0.630 0.14 0.7111 0.8364 0.729 0.04
Simple Effect Age-Sleep on Time=1 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.07 63.87 -0.91 0.3644 0.12 0.83 0.3656 0.11
Sleep on Old -0.03 43.04 -0.25 0.8032 0.04 0.06 0.7856 0.04
Age on Control -0.07 40.45 -0.66 0.5146 0.12 0.43 0.5311 0.11
Age on SR -0.02 44.40 -0.28 0.7831 0.05 0.08 0.7844 0.04
Simple Effect Age-Sleep on Time=1 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.07 63.87 -0.91 0.3644 0.12 0.83 0.3311 0.14
Sleep on Old -0.03 43.04 -0.25 0.8032 0.05 0.06 0.8022 0.04
Age on Control -0.07 40.45 -0.66 0.5146 0.09 0.43 0.5089 0.12
Age on SR -0.02 44.40 -0.28 0.7831 0.05 0.08 0.8056 0.04
YSR vs OC 0.00 35.64 0.03 0.9732 0.05 0.00 0.9756 0.04
Simple Effect Age-Sleep on Time=2 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.25 0.618 0.25 0.618 0.05 0.8190 0.5843 0.627 0.06
Sleep 0.12 0.734 0.12 0.734 0.20 0.6554 0.7529 0.729 0.03
Age*Sleep 0.02 0.895 0.02 0.850 0.00 0.9488 0.9583 0.889 0.04
Simple Effect Age-Sleep on Time=2 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.02 63.84 0.15 0.8788 0.03 0.02 0.8878 0.03
Sleep on Old 0.04 37.10 0.32 0.7471 0.06 0.11 0.7456 0.06
Age on Control -0.05 45.61 -0.40 0.6876 0.07 0.16 0.6744 0.06
Age on SR -0.03 52.80 -0.30 0.7676 0.05 0.09 0.7556 0.05
Simple Effect Age-Sleep on Time=2 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.02 63.84 0.15 0.8788 0.03 0.02 0.8756 0.04
Sleep on Old 0.04 37.10 0.32 0.7471 0.06 0.11 0.7467 0.06
Age on Control -0.05 45.61 -0.40 0.6876 0.07 0.16 0.6889 0.07
Age on SR -0.03 52.80 -0.30 0.7676 0.05 0.09 0.7667 0.06
YSR vs OC -0.07 42.53 -0.55 0.5874 0.10 0.30 0.5767 0.08
Simple Effect Age-Sleep on Time=3 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.53 0.470 0.53 0.470 0.39 0.5319 0.4658 0.462 0.08
Sleep 0.42 0.519 0.42 0.519 0.62 0.4330 0.5442 0.499 0.04
Age*Sleep 1.37 0.245 0.09 0.310 1.10 0.2948 0.2487 0.237 0.16
Simple Effect Age-Sleep on Time=3 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.04 61.52 -0.36 0.7193 0.06 0.13 0.7222 0.07
Sleep on Old 0.13 44.35 1.32 0.1942 0.21 1.74 0.1600 0.21
Age on Control -0.14 51.58 -1.36 0.1792 0.23 1.85 0.1744 0.21
Age on SR 0.03 52.94 0.31 0.7579 0.06 0.10 0.7733 0.05
Simple Effect Age-Sleep on Time=3 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.04 61.52 -0.36 0.7193 0.06 0.13 0.7011 0.06
Sleep on Old 0.13 44.35 1.32 0.1942 0.21 1.74 0.2000 0.20
Age on Control -0.14 51.58 -1.36 0.1792 0.22 1.85 0.1578 0.20
Age on SR 0.03 52.94 0.31 0.7579 0.06 0.10 0.7567 0.05
YSR vs OC -0.10 49.61 -0.93 0.3549 0.15 0.87 0.3522 0.14
Simple Effect Age-Sleep on Time=4 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 1.56 0.216 1.56 0.216 1.50 0.2225 0.1987 0.222 0.13
Sleep 0.36 0.552 0.36 0.552 0.70 0.4026 0.5860 0.558 0.04
Age*Sleep 1.10 0.296 0.09 0.330 0.94 0.3343 0.3489 0.301 0.16
Simple Effect Age-Sleep on Time=4 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.03 61.43 -0.33 0.7437 0.05 0.11 0.7511 0.04
Sleep on Old 0.11 41.58 1.14 0.2613 0.20 1.30 0.2656 0.19
Age on Control -0.15 45.95 -1.58 0.1218 0.24 2.48 0.1311 0.22
Age on SR -0.01 52.94 -0.14 0.8866 0.04 0.02 0.9067 0.05
Simple Effect Age-Sleep on Time=4 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.03 61.43 -0.33 0.7437 0.05 0.11 0.7400 0.05
Sleep on Old 0.11 41.58 1.14 0.2613 0.20 1.30 0.2522 0.19
Age on Control -0.15 45.95 -1.58 0.1218 0.23 2.48 0.1411 0.25
Age on SR -0.01 52.94 -0.14 0.8866 0.04 0.02 0.8933 0.04
YSR vs OC -0.12 46.87 -1.21 0.2333 0.21 1.46 0.2433 0.19
Simple Effect Age-Sleep on Time=5 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.11 0.746 0.11 0.746 0.77 0.3814 0.7496 0.752 0.06
Sleep 0.10 0.759 0.10 0.759 0.12 0.7285 0.7546 0.755 0.03
Age*Sleep 0.03 0.856 -0.04 0.680 0.17 0.6835 0.9316 0.875 0.08
Simple Effect Age-Sleep on Time=5 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.03 61.21 0.38 0.7053 0.06 0.14 0.7122 0.07
Sleep on Old 0.01 43.45 0.08 0.9346 0.04 0.01 0.9400 0.03
Age on Control 0.03 50.16 0.40 0.6896 0.10 0.16 0.6900 0.09
Age on SR 0.01 48.24 0.09 0.9268 0.03 0.01 0.9278 0.03
Simple Effect Age-Sleep on Time=5 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.03 61.21 0.38 0.7053 0.05 0.14 0.6989 0.06
Sleep on Old 0.01 43.45 0.08 0.9346 0.04 0.01 0.9367 0.03
Age on Control 0.03 50.16 0.40 0.6896 0.10 0.16 0.6844 0.08
Age on SR 0.01 48.24 0.09 0.9268 0.04 0.01 0.9278 0.03
YSR vs OC 0.00 49.26 0.01 0.9898 0.05 0.00 0.9967 0.05

10.6 Fig S1G Spatial information content {Design 2x2x(5xS)}

  NmBas="FigS1G SpatialInfCont"
  NmFAlL<-paste0(PathDesign,NmBas)
  if (!dir.exists(NmFAlL)) {dir.create(NmFAlL)}
  NmFAlL<-paste0(NmFAlL,"/")
  ResGen<-NA

  rrt<-ExDataIS.2(nmF = paste0(PathDesign,"Parameters.csv"),Vars = c(1,5,6,27:31),vIntP =c(4:8),lvlCh =  list("HAB"="InfoC_s1", "T1"="InfoC_s2","T2"="InfoC_s3","T3"="InfoC_s4","Test"="InfoC_s5"))
  DatDT<-rrt$DT
  ArP<-rrt$Arp
  ExtendDT<-rrt$ExtendDT
  
  # Simple Effects
  DatEfS<-list()
  for(is in 1:5) {
    DatEfS[[is]]<-ExData.2(nmF = paste0(PathDesign,"Parameters.csv"),Vars = c(5:6,(6+is)))
    names(DatEfS[[is]]$DT)[3]<-"DepV"
  }
  
  # Graphs
  Grp<- Grph.3(DatP = ExtendDT,"OPR",LblsP =c("Object Exploration", "","Spatial Information (bits/s)"),ylmP =c(0,3),hLin = F,lvIp=5)
  Grp2=Grp
    
    #AOV
    #A=2;B=2;C=5;DatPas=rrt;DatEfSp=DatEfS;nBMM1=nBMM2=1000;Prc=2
    names(rrt$DT)[4:8]<-c("T1","T2","T3","T4","T5")
    ResGen<-AOVMx2.5(A=2,B=2,C=5,DatPas = rrt,DatEfSp = DatEfS,nBMM1 = 1000,nBMM2 = 1000,Prc = 2)
 
    AlmacenGen2(GrpP = Grp,Grp2P = Grp2,DataPas = ResGen,PathDesignP = PathDesign,NmBasP = NmBas,Typ=2)
  
  # Other Graphs
    GrpO<-Grph.3.Otros(ExtendDT,LblsP =c("Object Exploration", "G","Spatial Information (bits/s)"))
    
    ExtendDTCol<-copy(ExtendDT)
    ExtendDTCol$Moment<-"All"
    ExtendDTCol<-data.table(rbind(ExtendDT,ExtendDTCol))
    
    Grp3<-Grph.3(DatP = ExtendDTCol,"OPR",LblsP =c("Object Exploration", "G","Spatial Information (bits/s)"),
                 ylmP =c(0,3),hLin = F,lvIp = 6,wMain = T)
   
    pdf(paste0(NmFAlL,NmBas,"OtrosGraphs.pdf"))
      Grp3
      GrpO
    dev.off()
    
    # Results
        # Results
        plot(Grp)
        plot(Grp2) # Only this graph is printed in the html file.
        GrpO
        plot(Grp3)
        ResGen # Lean option to view the results of statistical analysis
        
        Kbl3(ResPas = ResGen[[1]], lbl = "Omnibus AOV. Design 2x2x(5xS)");cat("\n")
        Kbl3(ResGen[[2]], "Interaction Age-Sleep. Design 2x2x(5xS)")
        Kbl3(ResGen[[3]], "Interaction Age-Time. Design 2x2x(5xS)")
        Kbl3(ResGen[[4]], "Interaction Sleep-Time. Design 2x2x(5xS)")
        Kbl3(ResGen[[5]], "Main Effect Time. Design 2x2x(5xS)")
        Kbl3(ResGen[[6]], "Simple Effect Time each Age-Sleep condition. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[1]][[1]], "Simple Effect Age-Sleep on Time=1 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[1]][[2]], "Simple Effect Age-Sleep on Time=1 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[1]][[3]], "Simple Effect Age-Sleep on Time=1 Extense Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[2]][[1]], "Simple Effect Age-Sleep on Time=2 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[2]][[2]], "Simple Effect Age-Sleep on Time=2 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[2]][[3]], "Simple Effect Age-Sleep on Time=2 Extense Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[3]][[1]], "Simple Effect Age-Sleep on Time=3 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[3]][[2]], "Simple Effect Age-Sleep on Time=3 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[3]][[3]], "Simple Effect Age-Sleep on Time=3 Extense Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[4]][[1]], "Simple Effect Age-Sleep on Time=4 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[4]][[2]], "Simple Effect Age-Sleep on Time=4 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[4]][[3]], "Simple Effect Age-Sleep on Time=4 Extense Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[5]][[1]], "Simple Effect Age-Sleep on Time=5 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[5]][[2]], "Simple Effect Age-Sleep on Time=5 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[5]][[3]], "Simple Effect Age-Sleep on Time=5 Extense Simple Effects. Design 2x2x(5xS)")
           Eff   p.V1 p.Sig
1:   p.value.A 0.5910      
2:   p.value.B 0.4541      
3:   p.value.C 0.0768      
4:  p.value.AB 0.7846      
5:  p.value.AC 0.5826      
6:  p.value.BC 0.1369      
7: p.value.ABC 0.4942      
           Eff   p.V1 p.Sig
1:   p.value.A 0.5470      
2:   p.value.B 0.5138      
3:   p.value.C 0.0955      
4:  p.value.AB 0.9340      
5:  p.value.AC 0.6908      
6:  p.value.BC 0.2250      
7: p.value.ABC 0.5430      
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
$BP

$Bars

$MargAB

$MargAC

$MargBC

$MargC

quartz_off_screen 
                2 
$BP

$Bars

$MargAB

$MargAC

$MargBC

$MargC

$AOV
            Names    Q      p  pBoot Sig pBootMas Sig2
1:            Age 0.36 0.5478 0.5910       0.5470     
2:          Sleep 0.43 0.5101 0.4541       0.5138     
3:           Time 0.82 0.5129 0.0768       0.0955     
4:      Age*Sleep 0.08 0.7769 0.7846       0.9340     
5:       Age*Time 0.22 0.9259 0.5826       0.6908     
6:     Sleep*Time 0.58 0.6775 0.1369       0.2250     
7: Age*Sleep*Time 0.31 0.8723 0.4942       0.5430     

$InterAB
            Contr psihat     df  test p.value EfSize.V1
1: Sleep on Young  -0.05 296.47 -0.24  0.8127      0.03
2:   Sleep on Old  -0.27 180.64 -1.26  0.2110      0.18
3: Age on Control  -0.02 222.08 -0.09  0.9279      0.08
4:      Age on SR  -0.25 198.31 -1.24  0.2152      0.20

$InterAC
             Contr psihat     df  test p.value EfSize.V1
 1:      Age on M1  -0.16  94.69 -1.16  0.2481      0.12
 2:      Age on M2  -0.14  89.56 -1.09  0.2767      0.11
 3:      Age on M3  -0.02 101.61 -0.19  0.8470      0.05
 4:      Age on M4   0.11  81.83  0.87  0.3884      0.10
 5:      Age on M5  -0.07  83.00 -0.43  0.6668      0.05
 6: M1-M2 on Young  -0.11     NA -0.87  0.3959      0.02
 7:   M1-M2 on Old  -0.06     NA -0.46  0.6475      0.03
 8: M2-M3 on Young   0.03     NA  0.24  0.8112      0.02
 9:   M2-M3 on Old   0.20     NA  1.28  0.2165      0.09
10: M3-M4 on Young  -0.14     NA -1.32  0.2024      0.12
11:   M3-M4 on Old  -0.09     NA -1.01  0.3271      0.02
12: M4-M5 on Young   0.01     NA  0.06  0.9515      0.11
13:   M4-M5 on Old  -0.29     NA -2.22  0.0392      0.24

$InterBC
             Contr psihat     df  test p.value EfSize.V1
 1:    Sleep on M1   0.11  94.69  0.84  0.4012      0.08
 2:    Sleep on M2   0.04  89.56  0.31  0.7573      0.03
 3:    Sleep on M3  -0.10 101.61 -0.94  0.3475      0.09
 4:    Sleep on M4  -0.07  81.83 -0.56  0.5798      0.04
 5:    Sleep on M5  -0.30  83.00 -1.95  0.0548      0.18
 6: M1-M2 on Young  -0.01     NA -0.15  0.8815      0.05
 7:   M1-M2 on Old  -0.15     NA -0.96  0.3486      0.01
 8: M2-M3 on Young   0.10     NA  0.83  0.4178      0.07
 9:   M2-M3 on Old   0.11     NA  0.66  0.5164      0.04
10: M3-M4 on Young  -0.20     NA -1.45  0.1628      0.09
11:   M3-M4 on Old  -0.09     NA -0.93  0.3620      0.05
12: M4-M5 on Young   0.01     NA  0.10  0.9205      0.07
13:   M4-M5 on Old  -0.39     NA -2.62  0.0168      0.25

$DetallMainC
   Contr psihat  test p.value Psihat2 p.value2 EfSize.V1
1: M1-M2  -0.17 -0.77  0.4483    0.07    0.824      0.02
2: M2-M3   0.28  1.30  0.2102    0.07    0.600      0.02
3: M3-M4  -0.30 -1.75  0.0966   -0.12    0.320      0.07
4: M4-M5  -0.43 -2.10  0.0496   -0.43    0.020      0.16

$DetallTrialCadaCondAB
            Contr psihat df  test p.value Psihat2 p.value2 dif.yuen df.yuen
 1:  M1-M2 on Y_C   0.00 NA  0.04  0.9707    0.03    0.860     0.04      32
 2: M1-M2 on Y_SR  -0.09 NA -1.58  0.1301   -0.01    0.940    -0.02      26
 3:  M1-M2 on O_C   0.00 NA -0.14  0.8937    0.04    0.612     0.07      19
 4: M1-M2 on O_SR   0.03 NA  0.29  0.7730    0.00    0.992     0.01      22
 5:  M2-M3 on Y_C   0.02 NA  0.58  0.5669    0.01    0.768     0.01      33
 6: M2-M3 on Y_SR   0.02 NA  0.15  0.8858   -0.03    0.756     0.01      27
 7:  M2-M3 on O_C   0.05 NA  0.43  0.6690    0.10    0.280     0.13      18
 8: M2-M3 on O_SR  -0.01 NA -0.07  0.9432   -0.01    0.952    -0.04      21
 9:  M3-M4 on Y_C  -0.11 NA -1.40  0.1779   -0.08    0.220    -0.07      34
10: M3-M4 on Y_SR  -0.10 NA -1.36  0.1895   -0.05    0.364    -0.06      30
11:  M3-M4 on O_C  -0.03 NA -0.26  0.7988    0.01    0.992    -0.04      19
12: M3-M4 on O_SR   0.04 NA  0.70  0.4917    0.00    0.988     0.02      23
13:  M4-M5 on Y_C   0.09 NA  1.19  0.2505   -0.05    0.472    -0.06      32
14: M4-M5 on Y_SR  -0.08 NA -1.24  0.2303   -0.08    0.132    -0.08      29
15:  M4-M5 on O_C  -0.02 NA -0.25  0.8061   -0.05    0.628    -0.07      21
16: M4-M5 on O_SR  -0.29 NA -3.39  0.0031   -0.25    0.008    -0.26      21
    test.yuen EffSize.yuen pvaluet.yuen
 1:      0.81         0.04       0.4236
 2:     -0.39         0.01       0.7016
 3:      1.04         0.07       0.3098
 4:      0.10         0.01       0.9219
 5:      0.28         0.01       0.7804
 6:      0.12         0.06       0.9082
 7:      1.76         0.21       0.0962
 8:     -0.65         0.02       0.5243
 9:     -1.48         0.12       0.1470
10:     -1.15         0.11       0.2583
11:     -0.44         0.04       0.6681
12:      0.40         0.02       0.6909
13:     -0.90         0.09       0.3763
14:     -1.48         0.13       0.1489
15:     -0.63         0.08       0.5374
16:     -2.28         0.39       0.0331

$DetallSimple
$DetallSimple[[1]]
$DetallSimple[[1]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 0.46 0.500   0.46  0.500  0.20 0.6559 0.4891        0.482       
2:     Sleep 0.53 0.469   0.53  0.469  0.58 0.4490 0.4841        0.473       
3: Age*Sleep 0.10 0.753   0.04  0.630  0.14 0.7111 0.8364        0.768       
   EffSize
1:    0.08
2:    0.10
3:    0.04

$DetallSimple[[1]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.07 63.87 -0.91  0.3644      0.12      0.83 0.3533
2:   Sleep on Old  -0.03 43.04 -0.25  0.8032      0.05      0.06 0.8089
3: Age on Control  -0.07 40.45 -0.66  0.5146      0.10      0.43 0.5067
4:      Age on SR  -0.02 44.40 -0.28  0.7831      0.06      0.08 0.7889
   EffSize.Boot
1:         0.12
2:         0.05
3:         0.11
4:         0.05

$DetallSimple[[1]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.07 63.87 -0.91  0.3644      0.12      0.83 0.3467
2:   Sleep on Old  -0.03 43.04 -0.25  0.8032      0.04      0.06 0.8022
3: Age on Control  -0.07 40.45 -0.66  0.5146      0.11      0.43 0.5033
4:      Age on SR  -0.02 44.40 -0.28  0.7831      0.04      0.08 0.7889
5:      YSR vs OC   0.00 35.64  0.03  0.9732      0.05      0.00 0.9756
   EffSize.Boot
1:         0.12
2:         0.05
3:         0.11
4:         0.04
5:         0.04


$DetallSimple[[2]]
$DetallSimple[[2]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 0.25 0.618   0.25  0.618  0.05 0.8190 0.5843        0.632       
2:     Sleep 0.12 0.734   0.12  0.734  0.20 0.6554 0.7529        0.740       
3: Age*Sleep 0.02 0.895   0.02  0.850  0.00 0.9488 0.9583        0.879       
   EffSize
1:    0.06
2:    0.03
3:    0.04

$DetallSimple[[2]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.02 63.84  0.15  0.8788      0.03      0.02 0.9000
2:   Sleep on Old   0.04 37.10  0.32  0.7471      0.06      0.11 0.7700
3: Age on Control  -0.05 45.61 -0.40  0.6876      0.07      0.16 0.6922
4:      Age on SR  -0.03 52.80 -0.30  0.7676      0.04      0.09 0.7556
   EffSize.Boot
1:         0.03
2:         0.06
3:         0.08
4:         0.05

$DetallSimple[[2]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.02 63.84  0.15  0.8788      0.03      0.02 0.8822
2:   Sleep on Old   0.04 37.10  0.32  0.7471      0.06      0.11 0.7500
3: Age on Control  -0.05 45.61 -0.40  0.6876      0.08      0.16 0.6811
4:      Age on SR  -0.03 52.80 -0.30  0.7676      0.04      0.09 0.7611
5:      YSR vs OC  -0.07 42.53 -0.55  0.5874      0.10      0.30 0.5767
   EffSize.Boot
1:         0.03
2:         0.06
3:         0.06
4:         0.06
5:         0.08


$DetallSimple[[3]]
$DetallSimple[[3]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 0.53 0.470   0.53  0.470  0.39 0.5319 0.4658        0.455       
2:     Sleep 0.42 0.519   0.42  0.519  0.62 0.4330 0.5442        0.498       
3: Age*Sleep 1.37 0.245   0.09  0.310  1.10 0.2948 0.2487        0.255       
   EffSize
1:    0.08
2:    0.04
3:    0.16

$DetallSimple[[3]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.04 61.52 -0.36  0.7193      0.06      0.13 0.7289
2:   Sleep on Old   0.13 44.35  1.32  0.1942      0.21      1.74 0.1944
3: Age on Control  -0.14 51.58 -1.36  0.1792      0.22      1.85 0.1978
4:      Age on SR   0.03 52.94  0.31  0.7579      0.06      0.10 0.7556
   EffSize.Boot
1:         0.06
2:         0.20
3:         0.23
4:         0.06

$DetallSimple[[3]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.04 61.52 -0.36  0.7193      0.06      0.13 0.7178
2:   Sleep on Old   0.13 44.35  1.32  0.1942      0.21      1.74 0.1789
3: Age on Control  -0.14 51.58 -1.36  0.1792      0.21      1.85 0.1733
4:      Age on SR   0.03 52.94  0.31  0.7579      0.06      0.10 0.7644
5:      YSR vs OC  -0.10 49.61 -0.93  0.3549      0.15      0.87 0.3522
   EffSize.Boot
1:         0.06
2:         0.21
3:         0.19
4:         0.05
5:         0.14


$DetallSimple[[4]]
$DetallSimple[[4]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 1.56 0.216   1.56  0.216  1.50 0.2225 0.1987        0.214       
2:     Sleep 0.36 0.552   0.36  0.552  0.70 0.4026 0.5860        0.560       
3: Age*Sleep 1.10 0.296   0.09  0.330  0.94 0.3343 0.3489        0.292       
   EffSize
1:    0.13
2:    0.04
3:    0.16

$DetallSimple[[4]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.03 61.43 -0.33  0.7437      0.05      0.11 0.7678
2:   Sleep on Old   0.11 41.58  1.14  0.2613      0.20      1.30 0.2756
3: Age on Control  -0.15 45.95 -1.58  0.1218      0.23      2.48 0.1067
4:      Age on SR  -0.01 52.94 -0.14  0.8866      0.04      0.02 0.9011
   EffSize.Boot
1:         0.05
2:         0.19
3:         0.25
4:         0.04

$DetallSimple[[4]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.03 61.43 -0.33  0.7437      0.06      0.11 0.7311
2:   Sleep on Old   0.11 41.58  1.14  0.2613      0.20      1.30 0.2500
3: Age on Control  -0.15 45.95 -1.58  0.1218      0.26      2.48 0.1300
4:      Age on SR  -0.01 52.94 -0.14  0.8866      0.04      0.02 0.9000
5:      YSR vs OC  -0.12 46.87 -1.21  0.2333      0.21      1.46 0.2433
   EffSize.Boot
1:         0.06
2:         0.19
3:         0.25
4:         0.04
5:         0.19


$DetallSimple[[5]]
$DetallSimple[[5]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 0.11 0.746   0.11  0.746  0.77 0.3814 0.7496        0.759       
2:     Sleep 0.10 0.759   0.10  0.759  0.12 0.7285 0.7546        0.725       
3: Age*Sleep 0.03 0.856  -0.04  0.680  0.17 0.6835 0.9316        0.873       
   EffSize
1:    0.06
2:    0.03
3:    0.08

$DetallSimple[[5]]$Detall
            Contr psihat    df test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.03 61.21 0.38  0.7053      0.05      0.14 0.7233
2:   Sleep on Old   0.01 43.45 0.08  0.9346      0.03      0.01 0.9422
3: Age on Control   0.03 50.16 0.40  0.6896      0.08      0.16 0.6956
4:      Age on SR   0.01 48.24 0.09  0.9268      0.04      0.01 0.9244
   EffSize.Boot
1:         0.06
2:         0.04
3:         0.08
4:         0.03

$DetallSimple[[5]]$DetallExt
            Contr psihat    df test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.03 61.21 0.38  0.7053      0.06      0.14 0.7356
2:   Sleep on Old   0.01 43.45 0.08  0.9346      0.04      0.01 0.9156
3: Age on Control   0.03 50.16 0.40  0.6896      0.08      0.16 0.7144
4:      Age on SR   0.01 48.24 0.09  0.9268      0.03      0.01 0.9333
5:      YSR vs OC   0.00 49.26 0.01  0.9898      0.05      0.00 0.9967
   EffSize.Boot
1:         0.05
2:         0.03
3:         0.08
4:         0.03
5:         0.05
Omnibus AOV. Design 2x2x(5xS)
Names Q p pBoot Sig pBootMas Sig2
Age 0.36 0.5478 0.5910 0.5470
Sleep 0.43 0.5101 0.4541 0.5138
Time 0.82 0.5129 0.0768 0.0955
Age*Sleep 0.08 0.7769 0.7846 0.9340
Age*Time 0.22 0.9259 0.5826 0.6908
Sleep*Time 0.58 0.6775 0.1369 0.2250
AgeSleepTime 0.31 0.8723 0.4942 0.5430
Interaction Age-Sleep. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1
Sleep on Young -0.05 296.47 -0.24 0.8127 0.03
Sleep on Old -0.27 180.64 -1.26 0.2110 0.18
Age on Control -0.02 222.08 -0.09 0.9279 0.08
Age on SR -0.25 198.31 -1.24 0.2152 0.20
Interaction Age-Time. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1
Age on M1 -0.16 94.69 -1.16 0.2481 0.12
Age on M2 -0.14 89.56 -1.09 0.2767 0.11
Age on M3 -0.02 101.61 -0.19 0.8470 0.05
Age on M4 0.11 81.83 0.87 0.3884 0.10
Age on M5 -0.07 83.00 -0.43 0.6668 0.05
M1-M2 on Young -0.11 NA -0.87 0.3959 0.02
M1-M2 on Old -0.06 NA -0.46 0.6475 0.03
M2-M3 on Young 0.03 NA 0.24 0.8112 0.02
M2-M3 on Old 0.20 NA 1.28 0.2165 0.09
M3-M4 on Young -0.14 NA -1.32 0.2024 0.12
M3-M4 on Old -0.09 NA -1.01 0.3271 0.02
M4-M5 on Young 0.01 NA 0.06 0.9515 0.11
M4-M5 on Old -0.29 NA -2.22 0.0392 0.24
Interaction Sleep-Time. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1
Sleep on M1 0.11 94.69 0.84 0.4012 0.08
Sleep on M2 0.04 89.56 0.31 0.7573 0.03
Sleep on M3 -0.10 101.61 -0.94 0.3475 0.09
Sleep on M4 -0.07 81.83 -0.56 0.5798 0.04
Sleep on M5 -0.30 83.00 -1.95 0.0548 0.18
M1-M2 on Young -0.01 NA -0.15 0.8815 0.05
M1-M2 on Old -0.15 NA -0.96 0.3486 0.01
M2-M3 on Young 0.10 NA 0.83 0.4178 0.07
M2-M3 on Old 0.11 NA 0.66 0.5164 0.04
M3-M4 on Young -0.20 NA -1.45 0.1628 0.09
M3-M4 on Old -0.09 NA -0.93 0.3620 0.05
M4-M5 on Young 0.01 NA 0.10 0.9205 0.07
M4-M5 on Old -0.39 NA -2.62 0.0168 0.25
Main Effect Time. Design 2x2x(5xS)
Contr psihat test p.value Psihat2 p.value2 EfSize.V1
M1-M2 -0.17 -0.77 0.4483 0.07 0.824 0.02
M2-M3 0.28 1.30 0.2102 0.07 0.600 0.02
M3-M4 -0.30 -1.75 0.0966 -0.12 0.320 0.07
M4-M5 -0.43 -2.10 0.0496 -0.43 0.020 0.16
Simple Effect Time each Age-Sleep condition. Design 2x2x(5xS)
Contr psihat df test p.value Psihat2 p.value2 dif.yuen df.yuen test.yuen EffSize.yuen pvaluet.yuen
M1-M2 on Y_C 0.00 NA 0.04 0.9707 0.03 0.860 0.04 32 0.81 0.04 0.4236
M1-M2 on Y_SR -0.09 NA -1.58 0.1301 -0.01 0.940 -0.02 26 -0.39 0.01 0.7016
M1-M2 on O_C 0.00 NA -0.14 0.8937 0.04 0.612 0.07 19 1.04 0.07 0.3098
M1-M2 on O_SR 0.03 NA 0.29 0.7730 0.00 0.992 0.01 22 0.10 0.01 0.9219
M2-M3 on Y_C 0.02 NA 0.58 0.5669 0.01 0.768 0.01 33 0.28 0.01 0.7804
M2-M3 on Y_SR 0.02 NA 0.15 0.8858 -0.03 0.756 0.01 27 0.12 0.06 0.9082
M2-M3 on O_C 0.05 NA 0.43 0.6690 0.10 0.280 0.13 18 1.76 0.21 0.0962
M2-M3 on O_SR -0.01 NA -0.07 0.9432 -0.01 0.952 -0.04 21 -0.65 0.02 0.5243
M3-M4 on Y_C -0.11 NA -1.40 0.1779 -0.08 0.220 -0.07 34 -1.48 0.12 0.1470
M3-M4 on Y_SR -0.10 NA -1.36 0.1895 -0.05 0.364 -0.06 30 -1.15 0.11 0.2583
M3-M4 on O_C -0.03 NA -0.26 0.7988 0.01 0.992 -0.04 19 -0.44 0.04 0.6681
M3-M4 on O_SR 0.04 NA 0.70 0.4917 0.00 0.988 0.02 23 0.40 0.02 0.6909
M4-M5 on Y_C 0.09 NA 1.19 0.2505 -0.05 0.472 -0.06 32 -0.90 0.09 0.3763
M4-M5 on Y_SR -0.08 NA -1.24 0.2303 -0.08 0.132 -0.08 29 -1.48 0.13 0.1489
M4-M5 on O_C -0.02 NA -0.25 0.8061 -0.05 0.628 -0.07 21 -0.63 0.08 0.5374
M4-M5 on O_SR -0.29 NA -3.39 0.0031 -0.25 0.008 -0.26 21 -2.28 0.39 0.0331
Simple Effect Age-Sleep on Time=1 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.46 0.500 0.46 0.500 0.20 0.6559 0.4891 0.482 0.08
Sleep 0.53 0.469 0.53 0.469 0.58 0.4490 0.4841 0.473 0.10
Age*Sleep 0.10 0.753 0.04 0.630 0.14 0.7111 0.8364 0.768 0.04
Simple Effect Age-Sleep on Time=1 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.07 63.87 -0.91 0.3644 0.12 0.83 0.3533 0.12
Sleep on Old -0.03 43.04 -0.25 0.8032 0.05 0.06 0.8089 0.05
Age on Control -0.07 40.45 -0.66 0.5146 0.10 0.43 0.5067 0.11
Age on SR -0.02 44.40 -0.28 0.7831 0.06 0.08 0.7889 0.05
Simple Effect Age-Sleep on Time=1 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.07 63.87 -0.91 0.3644 0.12 0.83 0.3467 0.12
Sleep on Old -0.03 43.04 -0.25 0.8032 0.04 0.06 0.8022 0.05
Age on Control -0.07 40.45 -0.66 0.5146 0.11 0.43 0.5033 0.11
Age on SR -0.02 44.40 -0.28 0.7831 0.04 0.08 0.7889 0.04
YSR vs OC 0.00 35.64 0.03 0.9732 0.05 0.00 0.9756 0.04
Simple Effect Age-Sleep on Time=2 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.25 0.618 0.25 0.618 0.05 0.8190 0.5843 0.632 0.06
Sleep 0.12 0.734 0.12 0.734 0.20 0.6554 0.7529 0.740 0.03
Age*Sleep 0.02 0.895 0.02 0.850 0.00 0.9488 0.9583 0.879 0.04
Simple Effect Age-Sleep on Time=2 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.02 63.84 0.15 0.8788 0.03 0.02 0.9000 0.03
Sleep on Old 0.04 37.10 0.32 0.7471 0.06 0.11 0.7700 0.06
Age on Control -0.05 45.61 -0.40 0.6876 0.07 0.16 0.6922 0.08
Age on SR -0.03 52.80 -0.30 0.7676 0.04 0.09 0.7556 0.05
Simple Effect Age-Sleep on Time=2 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.02 63.84 0.15 0.8788 0.03 0.02 0.8822 0.03
Sleep on Old 0.04 37.10 0.32 0.7471 0.06 0.11 0.7500 0.06
Age on Control -0.05 45.61 -0.40 0.6876 0.08 0.16 0.6811 0.06
Age on SR -0.03 52.80 -0.30 0.7676 0.04 0.09 0.7611 0.06
YSR vs OC -0.07 42.53 -0.55 0.5874 0.10 0.30 0.5767 0.08
Simple Effect Age-Sleep on Time=3 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.53 0.470 0.53 0.470 0.39 0.5319 0.4658 0.455 0.08
Sleep 0.42 0.519 0.42 0.519 0.62 0.4330 0.5442 0.498 0.04
Age*Sleep 1.37 0.245 0.09 0.310 1.10 0.2948 0.2487 0.255 0.16
Simple Effect Age-Sleep on Time=3 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.04 61.52 -0.36 0.7193 0.06 0.13 0.7289 0.06
Sleep on Old 0.13 44.35 1.32 0.1942 0.21 1.74 0.1944 0.20
Age on Control -0.14 51.58 -1.36 0.1792 0.22 1.85 0.1978 0.23
Age on SR 0.03 52.94 0.31 0.7579 0.06 0.10 0.7556 0.06
Simple Effect Age-Sleep on Time=3 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.04 61.52 -0.36 0.7193 0.06 0.13 0.7178 0.06
Sleep on Old 0.13 44.35 1.32 0.1942 0.21 1.74 0.1789 0.21
Age on Control -0.14 51.58 -1.36 0.1792 0.21 1.85 0.1733 0.19
Age on SR 0.03 52.94 0.31 0.7579 0.06 0.10 0.7644 0.05
YSR vs OC -0.10 49.61 -0.93 0.3549 0.15 0.87 0.3522 0.14
Simple Effect Age-Sleep on Time=4 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 1.56 0.216 1.56 0.216 1.50 0.2225 0.1987 0.214 0.13
Sleep 0.36 0.552 0.36 0.552 0.70 0.4026 0.5860 0.560 0.04
Age*Sleep 1.10 0.296 0.09 0.330 0.94 0.3343 0.3489 0.292 0.16
Simple Effect Age-Sleep on Time=4 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.03 61.43 -0.33 0.7437 0.05 0.11 0.7678 0.05
Sleep on Old 0.11 41.58 1.14 0.2613 0.20 1.30 0.2756 0.19
Age on Control -0.15 45.95 -1.58 0.1218 0.23 2.48 0.1067 0.25
Age on SR -0.01 52.94 -0.14 0.8866 0.04 0.02 0.9011 0.04
Simple Effect Age-Sleep on Time=4 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.03 61.43 -0.33 0.7437 0.06 0.11 0.7311 0.06
Sleep on Old 0.11 41.58 1.14 0.2613 0.20 1.30 0.2500 0.19
Age on Control -0.15 45.95 -1.58 0.1218 0.26 2.48 0.1300 0.25
Age on SR -0.01 52.94 -0.14 0.8866 0.04 0.02 0.9000 0.04
YSR vs OC -0.12 46.87 -1.21 0.2333 0.21 1.46 0.2433 0.19
Simple Effect Age-Sleep on Time=5 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.11 0.746 0.11 0.746 0.77 0.3814 0.7496 0.759 0.06
Sleep 0.10 0.759 0.10 0.759 0.12 0.7285 0.7546 0.725 0.03
Age*Sleep 0.03 0.856 -0.04 0.680 0.17 0.6835 0.9316 0.873 0.08
Simple Effect Age-Sleep on Time=5 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.03 61.21 0.38 0.7053 0.05 0.14 0.7233 0.06
Sleep on Old 0.01 43.45 0.08 0.9346 0.03 0.01 0.9422 0.04
Age on Control 0.03 50.16 0.40 0.6896 0.08 0.16 0.6956 0.08
Age on SR 0.01 48.24 0.09 0.9268 0.04 0.01 0.9244 0.03
Simple Effect Age-Sleep on Time=5 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.03 61.21 0.38 0.7053 0.06 0.14 0.7356 0.05
Sleep on Old 0.01 43.45 0.08 0.9346 0.04 0.01 0.9156 0.03
Age on Control 0.03 50.16 0.40 0.6896 0.08 0.16 0.7144 0.08
Age on SR 0.01 48.24 0.09 0.9268 0.03 0.01 0.9333 0.03
YSR vs OC 0.00 49.26 0.01 0.9898 0.05 0.00 0.9967 0.05

10.7 Fig S1H Cluster Quality L-ratio {Design 2x2x(5xS)}

  NmBas="FigS1H LRatio"
  NmFAlL<-paste0(PathDesign,NmBas)
    if (!dir.exists(NmFAlL)) {dir.create(NmFAlL)}
    NmFAlL<-paste0(NmFAlL,"/")

  rrt<-ExDataIS.2(nmF = paste0(PathDesign,"ClusterQuality.csv"),Vars = c(1,5,6,12:16),vIntP =c(4:8),lvlCh = list("HAB"="LR_s1", "T1"="LR_s2","T2"="LR_s3","T3"="LR_s4","Test"="LR_s5"))
  DatDT<-rrt$DT
  ArP<-rrt$Arp
  ExtendDT<-rrt$ExtendDT
  
  # Simple Effects
  DatEfS<-list()
  for(is in 1:5) {
    DatEfS[[is]]<-ExData.2(nmF = paste0(PathDesign,"ClusterQuality.csv"),Vars = c(5:6,(11+is)))
    names(DatEfS[[is]]$DT)[3]<-"DepV"
  }
  
  #Graphs
  Grp<- Grph.3(DatP = ExtendDT,"OPR",LblsP =c("Cluster Quality", "","L-Ratio"),ylmP =c(0,10),hLin = F,lvIp=5)
  Grp2=Grp
    
    #AOV
    names(rrt$DT)[4:8]<-c("T1","T2","T3","T4","T5")
    ResGen<-AOVMx2.5(A=2,B=2,C=5,DatPas = rrt,DatEfSp = DatEfS,nBMM1 = 1000,nBMM2 = 1000,Prc = 2)
    AlmacenGen2(GrpP = Grp,Grp2P = Grp2,DataPas = ResGen,PathDesignP = PathDesign,NmBasP = NmBas,Typ=2)
  
  # Other Graphs
    GrpO<-Grph.3.Otros(ExtendDT,LblsP =c("Cluster Quality", "I","L-Ratio"))
    
    ExtendDTCol<-copy(ExtendDT)
    ExtendDTCol$Moment<-"All"
    ExtendDTCol<-data.table(rbind(ExtendDT,ExtendDTCol))
    
    Grp3<-Grph.3(DatP = ExtendDTCol,"OPR",LblsP =c("Cluster Quality", "I","L-Ratio"),
                 ylmP =c(0,10),hLin = F,lvIp = 6,wMain = T)
   
    pdf(paste0(NmFAlL,NmBas,"OtrosGraphs.pdf"))
      Grp3
      GrpO
    dev.off()
    
        # Results
        plot(Grp)
        plot(Grp2) # Only this graph is printed in the html file.
        GrpO
        plot(Grp3)
        ResGen # Lean option to view the results of statistical analysis
        
        Kbl3(ResPas = ResGen[[1]], lbl = "Omnibus AOV. Design 2x2x(5xS)");cat("\n")
        Kbl3(ResGen[[2]], "Interaction Age-Sleep. Design 2x2x(5xS)")
        Kbl3(ResGen[[3]], "Interaction Age-Time. Design 2x2x(5xS)")
        Kbl3(ResGen[[4]], "Interaction Sleep-Time. Design 2x2x(5xS)")
        Kbl3(ResGen[[5]], "Main Effect Time. Design 2x2x(5xS)")
        Kbl3(ResGen[[6]], "Simple Effect Time each Age-Sleep condition. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[1]][[1]], "Simple Effect Age-Sleep on Time=1 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[1]][[2]], "Simple Effect Age-Sleep on Time=1 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[1]][[3]], "Simple Effect Age-Sleep on Time=1 Extense Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[2]][[1]], "Simple Effect Age-Sleep on Time=2 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[2]][[2]], "Simple Effect Age-Sleep on Time=2 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[2]][[3]], "Simple Effect Age-Sleep on Time=2 Extense Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[3]][[1]], "Simple Effect Age-Sleep on Time=3 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[3]][[2]], "Simple Effect Age-Sleep on Time=3 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[3]][[3]], "Simple Effect Age-Sleep on Time=3 Extense Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[4]][[1]], "Simple Effect Age-Sleep on Time=4 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[4]][[2]], "Simple Effect Age-Sleep on Time=4 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[4]][[3]], "Simple Effect Age-Sleep on Time=4 Extense Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[5]][[1]], "Simple Effect Age-Sleep on Time=5 Omnibus AOV. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[5]][[2]], "Simple Effect Age-Sleep on Time=5 Simple Effects. Design 2x2x(5xS)")
        Kbl3(ResGen[[7]][[5]][[3]], "Simple Effect Age-Sleep on Time=5 Extense Simple Effects. Design 2x2x(5xS)")
           Eff   p.V1 p.Sig
1:   p.value.A 0.3556      
2:   p.value.B 0.7646      
3:   p.value.C 0.2404      
4:  p.value.AB 0.9716      
5:  p.value.AC 0.4374      
6:  p.value.BC 0.2805      
7: p.value.ABC 0.8080      
           Eff   p.V1 p.Sig
1:   p.value.A 0.3485      
2:   p.value.B 0.7570      
3:   p.value.C 0.3200      
4:  p.value.AB 1.0000      
5:  p.value.AC 0.5398      
6:  p.value.BC 0.3662      
7: p.value.ABC 0.8480      
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
$BP

$Bars

$MargAB

$MargAC

$MargBC

$MargC

quartz_off_screen 
                2 
$BP

$Bars

$MargAB

$MargAC

$MargBC

$MargC

$AOV
            Names    Q      p  pBoot Sig pBootMas Sig2
1:            Age 0.91 0.3409 0.3556       0.3485     
2:          Sleep 0.09 0.7617 0.7646       0.7570     
3:           Time 0.48 0.7522 0.2404       0.3200     
4:      Age*Sleep 0.00 0.9663 0.9716       1.0000     
5:       Age*Time 0.31 0.8698 0.4374       0.5398     
6:     Sleep*Time 0.44 0.7804 0.2805       0.3662     
7: Age*Sleep*Time 0.14 0.9683 0.8080       0.8480     

$InterAB
            Contr psihat     df  test p.value EfSize.V1
1: Sleep on Young  -0.07 274.10 -0.36  0.7212      0.07
2:   Sleep on Old  -0.05 200.25 -0.21  0.8344      0.04
3: Age on Control  -0.20 179.18 -0.90  0.3696      0.13
4:      Age on SR  -0.18 235.62 -0.81  0.4214      0.07

$InterAC
             Contr psihat    df  test p.value EfSize.V1
 1:      Age on M1  -0.06 92.92 -0.46  0.6475      0.05
 2:      Age on M2   0.04 97.52  0.29  0.7736      0.03
 3:      Age on M3  -0.04 84.43 -0.28  0.7767      0.04
 4:      Age on M4  -0.30 91.69 -1.88  0.0631      0.20
 5:      Age on M5  -0.02 60.17 -0.13  0.8991      0.03
 6: M1-M2 on Young  -0.02    NA -0.22  0.8276      0.04
 7:   M1-M2 on Old   0.04    NA  0.30  0.7648      0.03
 8: M2-M3 on Young   0.09    NA  1.17  0.2562      0.07
 9:   M2-M3 on Old   0.14    NA  1.48  0.1539      0.02
10: M3-M4 on Young   0.01    NA  0.07  0.9445      0.06
11:   M3-M4 on Old  -0.29    NA -2.20  0.0392      0.23
12: M4-M5 on Young   0.07    NA  0.65  0.5246      0.02
13:   M4-M5 on Old   0.35    NA  1.87  0.0750      0.22

$InterBC
             Contr psihat    df  test p.value EfSize.V1
 1:    Sleep on M1  -0.02 92.92 -0.11  0.9097      0.02
 2:    Sleep on M2  -0.20 97.52 -1.49  0.1405      0.16
 3:    Sleep on M3  -0.13 84.43 -0.97  0.3343      0.09
 4:    Sleep on M4   0.07 91.69  0.42  0.6744      0.03
 5:    Sleep on M5   0.16 60.17  1.14  0.2593      0.12
 6: M1-M2 on Young  -0.02    NA -0.21  0.8373      0.06
 7:   M1-M2 on Old   0.02    NA  0.33  0.7410      0.09
 8: M2-M3 on Young  -0.02    NA -0.20  0.8440      0.02
 9:   M2-M3 on Old   0.10    NA  0.76  0.4569      0.08
10: M3-M4 on Young  -0.21    NA -2.44  0.0236      0.21
11:   M3-M4 on Old  -0.04    NA -0.42  0.6754      0.08
12: M4-M5 on Young   0.04    NA  0.22  0.8263      0.08
13:   M4-M5 on Old   0.24    NA  2.06  0.0516      0.16

$DetallMainC
   Contr psihat  test p.value Psihat2 p.value2 EfSize.V1
1: M1-M2  -0.02 -0.14  0.8897   -0.02    0.864      0.02
2: M2-M3   0.16  1.23  0.2319    0.12    0.472      0.05
3: M3-M4  -0.25 -1.62  0.1192   -0.43    0.020      0.14
4: M4-M5   0.32  1.32  0.2013    0.35    0.196      0.12

$DetallTrialCadaCondAB
            Contr psihat df  test p.value Psihat2 p.value2 dif.yuen df.yuen
 1:  M1-M2 on Y_C  -0.02 NA -0.58  0.5702    0.01    0.836     0.01      35
 2: M1-M2 on Y_SR  -0.04 NA -0.62  0.5421   -0.07    0.372    -0.07      29
 3:  M1-M2 on O_C   0.06 NA  0.58  0.5663    0.07    0.440     0.07      21
 4: M1-M2 on O_SR   0.02 NA  0.38  0.7094   -0.03    0.656    -0.03      24
 5:  M2-M3 on Y_C  -0.02 NA -0.56  0.5790    0.00    0.848     0.00      35
 6: M2-M3 on Y_SR   0.06 NA  1.33  0.1986    0.10    0.240     0.10      29
 7:  M2-M3 on O_C  -0.01 NA -0.23  0.8169    0.03    0.712     0.03      21
 8: M2-M3 on O_SR   0.05 NA  0.53  0.6043   -0.01    0.984    -0.01      24
 9:  M3-M4 on Y_C   0.00 NA -0.12  0.9054   -0.05    0.464    -0.05      35
10: M3-M4 on Y_SR   0.02 NA  0.25  0.8047   -0.03    0.740    -0.03      29
11:  M3-M4 on O_C  -0.21 NA -2.31  0.0312   -0.26    0.032    -0.26      21
12: M3-M4 on O_SR  -0.04 NA -0.65  0.5234   -0.08    0.304    -0.08      24
13:  M4-M5 on Y_C   0.05 NA  0.50  0.6254    0.01    0.972     0.03      32
14: M4-M5 on Y_SR  -0.01 NA -0.09  0.9254    0.02    0.684     0.02      29
15:  M4-M5 on O_C   0.10 NA  0.96  0.3470    0.12    0.472     0.12      21
16: M4-M5 on O_SR   0.25 NA  2.38  0.0271    0.20    0.104     0.20      24
    test.yuen EffSize.yuen pvaluet.yuen
 1:      0.17         0.02       0.8654
 2:     -0.92         0.11       0.3669
 3:      0.80         0.13       0.4314
 4:     -0.41         0.05       0.6869
 5:     -0.06         0.01       0.9554
 6:      1.34         0.16       0.1913
 7:      0.35         0.05       0.7316
 8:     -0.09         0.01       0.9300
 9:     -0.85         0.09       0.4019
10:     -0.30         0.04       0.7688
11:     -2.26         0.35       0.0346
12:     -0.96         0.12       0.3474
13:      0.34         0.02       0.7371
14:      0.32         0.04       0.7547
15:      0.86         0.16       0.3975
16:      1.85         0.27       0.0772

$DetallSimple
$DetallSimple[[1]]
$DetallSimple[[1]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 0.21 0.648   0.21  0.648  0.11 0.7462 0.6795        0.657       
2:     Sleep 0.01 0.910   0.01  0.910  0.01 0.9208 0.8998        0.900       
3: Age*Sleep 0.07 0.790   0.01  0.920  0.00 0.9452 0.8581        0.797       
   EffSize
1:    0.05
2:    0.01
3:    0.01

$DetallSimple[[1]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.03 55.17 -0.30  0.7673      0.04      0.09 0.7511
2:   Sleep on Old   0.01 45.00  0.10  0.9203      0.03      0.01 0.9300
3: Age on Control  -0.05 41.78 -0.56  0.5772      0.08      0.32 0.5711
4:      Age on SR  -0.01 51.48 -0.12  0.9010      0.03      0.02 0.8944
   EffSize.Boot
1:         0.04
2:         0.03
3:         0.09
4:         0.04

$DetallSimple[[1]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.03 55.17 -0.30  0.7673      0.04      0.09 0.7811
2:   Sleep on Old   0.01 45.00  0.10  0.9203      0.03      0.01 0.9222
3: Age on Control  -0.05 41.78 -0.56  0.5772      0.08      0.32 0.5511
4:      Age on SR  -0.01 51.48 -0.12  0.9010      0.04      0.02 0.9111
5:      YSR vs OC  -0.02 48.53 -0.23  0.8160      0.05      0.05 0.8233
   EffSize.Boot
1:         0.04
2:         0.03
3:         0.09
4:         0.04
5:         0.05


$DetallSimple[[2]]
$DetallSimple[[2]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 0.08 0.774   0.08  0.774  0.02 0.8836 0.7880        0.772       
2:     Sleep 2.21 0.141   2.21  0.141  1.06 0.3056 0.1285        0.128       
3: Age*Sleep 0.01 0.924  -0.01  0.940  0.01 0.9108 0.9499        0.910       
   EffSize
1:    0.04
2:    0.16
3:    0.02

$DetallSimple[[2]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.11 60.14 -1.20  0.2342      0.17      1.44 0.2289
2:   Sleep on Old  -0.09 44.99 -0.92  0.3609      0.17      0.85 0.3578
3: Age on Control   0.01 46.41  0.14  0.8872      0.05      0.02 0.8878
4:      Age on SR   0.03 51.33  0.26  0.7959      0.04      0.07 0.7944
   EffSize.Boot
1:         0.17
2:         0.17
3:         0.06
4:         0.05

$DetallSimple[[2]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  -0.11 60.14 -1.20  0.2342      0.18      1.44 0.2278
2:   Sleep on Old  -0.09 44.99 -0.92  0.3609      0.16      0.85 0.3544
3: Age on Control   0.01 46.41  0.14  0.8872      0.05      0.02 0.8789
4:      Age on SR   0.03 51.33  0.26  0.7959      0.05      0.07 0.7778
5:      YSR vs OC   0.12 48.17  1.23  0.2243      0.19      1.52 0.2289
   EffSize.Boot
1:         0.17
2:         0.15
3:         0.06
4:         0.05
5:         0.19


$DetallSimple[[3]]
$DetallSimple[[3]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 0.08 0.777   0.08  0.777  0.09 0.7682 0.7746        0.781       
2:     Sleep 0.94 0.335   0.94  0.335  0.31 0.5768 0.3306        0.306       
3: Age*Sleep 0.91 0.344  -0.07  0.430  0.78 0.3787 0.3756        0.345       
   EffSize
1:    0.03
2:    0.09
3:    0.13

$DetallSimple[[3]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.00 59.76 -0.02  0.9879      0.03      0.00 0.9956
2:   Sleep on Old  -0.13 44.95 -1.17  0.2466      0.20      1.38 0.2533
3: Age on Control   0.05 38.23  0.49  0.6251      0.07      0.24 0.6178
4:      Age on SR  -0.08 46.23 -0.84  0.4034      0.13      0.71 0.3911
   EffSize.Boot
1:         0.03
2:         0.20
3:         0.09
4:         0.14

$DetallSimple[[3]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.00 59.76 -0.02  0.9879      0.03      0.00 0.9856
2:   Sleep on Old  -0.13 44.95 -1.17  0.2466      0.19      1.38 0.2400
3: Age on Control   0.05 38.23  0.49  0.6251      0.08      0.24 0.6000
4:      Age on SR  -0.08 46.23 -0.84  0.4034      0.13      0.71 0.3967
5:      YSR vs OC   0.05 42.43  0.48  0.6357      0.09      0.23 0.6211
   EffSize.Boot
1:         0.03
2:         0.20
3:         0.09
4:         0.13
5:         0.07


$DetallSimple[[4]]
$DetallSimple[[4]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot   Sig pBootMas SigMas
1:       Age 3.54 0.063   3.54  0.063  2.35 0.1275 0.0484 *        0.058       
2:     Sleep 0.18 0.675   0.18  0.675  0.34 0.5602 0.6461          0.682       
3: Age*Sleep 0.01 0.905  -0.01  0.900  0.00 0.9560 0.8047          0.884       
   EffSize
1:    0.20
2:    0.03
3:    0.01

$DetallSimple[[4]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.02 54.48  0.24  0.8141      0.04      0.06 0.8244
2:   Sleep on Old   0.04 44.83  0.35  0.7270      0.07      0.12 0.7322
3: Age on Control  -0.16 39.85 -1.52  0.1362      0.23      2.31 0.1556
4:      Age on SR  -0.14 51.84 -1.17  0.2475      0.18      1.37 0.2533
   EffSize.Boot
1:         0.04
2:         0.06
3:         0.25
4:         0.19

$DetallSimple[[4]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.02 54.48  0.24  0.8141      0.04      0.06 0.7989
2:   Sleep on Old   0.04 44.83  0.35  0.7270      0.05      0.12 0.7244
3: Age on Control  -0.16 39.85 -1.52  0.1362      0.21      2.31 0.1589
4:      Age on SR  -0.14 51.84 -1.17  0.2475      0.18      1.37 0.2756
5:      YSR vs OC  -0.18 47.84 -1.53  0.1317      0.24      2.35 0.1378
   EffSize.Boot
1:         0.04
2:         0.05
3:         0.23
4:         0.18
5:         0.24


$DetallSimple[[5]]
$DetallSimple[[5]]$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1 pBoot Sig pBootMas SigMas
1:       Age 0.02 0.900   0.02   0.90  0.28 0.5992    NA            1       
2:     Sleep 1.30 0.260   1.30   0.26  2.28 0.1332    NA            0  *    
3: Age*Sleep 0.32 0.572  -0.02   0.84  0.29 0.5935    NA            0  *    
   EffSize
1:    0.03
2:    0.12
3:    0.03

$DetallSimple[[5]]$Detall
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.04 60.73  0.50  0.6160      0.08      0.25 0.6100
2:   Sleep on Old   0.12 31.06  1.03  0.3087      0.15      1.07 0.3033
3: Age on Control  -0.05 33.00 -0.42  0.6802      0.08      0.17 0.6944
4:      Age on SR   0.03 53.00  0.41  0.6868      0.06      0.16 0.6911
   EffSize.Boot
1:         0.08
2:         0.16
3:         0.07
4:         0.06

$DetallSimple[[5]]$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   0.04 60.73  0.50  0.6160      0.08      0.25 0.6267
2:   Sleep on Old   0.12 31.06  1.03  0.3087      0.16      1.07 0.2978
3: Age on Control  -0.05 33.00 -0.42  0.6802      0.07      0.17 0.6844
4:      Age on SR   0.03 53.00  0.41  0.6868      0.06      0.16 0.6756
5:      YSR vs OC  -0.09 33.21 -0.75  0.4571      0.14      0.57 0.4722
   EffSize.Boot
1:         0.07
2:         0.15
3:         0.08
4:         0.07
5:         0.13
Omnibus AOV. Design 2x2x(5xS)
Names Q p pBoot Sig pBootMas Sig2
Age 0.91 0.3409 0.3556 0.3485
Sleep 0.09 0.7617 0.7646 0.7570
Time 0.48 0.7522 0.2404 0.3200
Age*Sleep 0.00 0.9663 0.9716 1.0000
Age*Time 0.31 0.8698 0.4374 0.5398
Sleep*Time 0.44 0.7804 0.2805 0.3662
AgeSleepTime 0.14 0.9683 0.8080 0.8480
Interaction Age-Sleep. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1
Sleep on Young -0.07 274.10 -0.36 0.7212 0.07
Sleep on Old -0.05 200.25 -0.21 0.8344 0.04
Age on Control -0.20 179.18 -0.90 0.3696 0.13
Age on SR -0.18 235.62 -0.81 0.4214 0.07
Interaction Age-Time. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1
Age on M1 -0.06 92.92 -0.46 0.6475 0.05
Age on M2 0.04 97.52 0.29 0.7736 0.03
Age on M3 -0.04 84.43 -0.28 0.7767 0.04
Age on M4 -0.30 91.69 -1.88 0.0631 0.20
Age on M5 -0.02 60.17 -0.13 0.8991 0.03
M1-M2 on Young -0.02 NA -0.22 0.8276 0.04
M1-M2 on Old 0.04 NA 0.30 0.7648 0.03
M2-M3 on Young 0.09 NA 1.17 0.2562 0.07
M2-M3 on Old 0.14 NA 1.48 0.1539 0.02
M3-M4 on Young 0.01 NA 0.07 0.9445 0.06
M3-M4 on Old -0.29 NA -2.20 0.0392 0.23
M4-M5 on Young 0.07 NA 0.65 0.5246 0.02
M4-M5 on Old 0.35 NA 1.87 0.0750 0.22
Interaction Sleep-Time. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1
Sleep on M1 -0.02 92.92 -0.11 0.9097 0.02
Sleep on M2 -0.20 97.52 -1.49 0.1405 0.16
Sleep on M3 -0.13 84.43 -0.97 0.3343 0.09
Sleep on M4 0.07 91.69 0.42 0.6744 0.03
Sleep on M5 0.16 60.17 1.14 0.2593 0.12
M1-M2 on Young -0.02 NA -0.21 0.8373 0.06
M1-M2 on Old 0.02 NA 0.33 0.7410 0.09
M2-M3 on Young -0.02 NA -0.20 0.8440 0.02
M2-M3 on Old 0.10 NA 0.76 0.4569 0.08
M3-M4 on Young -0.21 NA -2.44 0.0236 0.21
M3-M4 on Old -0.04 NA -0.42 0.6754 0.08
M4-M5 on Young 0.04 NA 0.22 0.8263 0.08
M4-M5 on Old 0.24 NA 2.06 0.0516 0.16
Main Effect Time. Design 2x2x(5xS)
Contr psihat test p.value Psihat2 p.value2 EfSize.V1
M1-M2 -0.02 -0.14 0.8897 -0.02 0.864 0.02
M2-M3 0.16 1.23 0.2319 0.12 0.472 0.05
M3-M4 -0.25 -1.62 0.1192 -0.43 0.020 0.14
M4-M5 0.32 1.32 0.2013 0.35 0.196 0.12
Simple Effect Time each Age-Sleep condition. Design 2x2x(5xS)
Contr psihat df test p.value Psihat2 p.value2 dif.yuen df.yuen test.yuen EffSize.yuen pvaluet.yuen
M1-M2 on Y_C -0.02 NA -0.58 0.5702 0.01 0.836 0.01 35 0.17 0.02 0.8654
M1-M2 on Y_SR -0.04 NA -0.62 0.5421 -0.07 0.372 -0.07 29 -0.92 0.11 0.3669
M1-M2 on O_C 0.06 NA 0.58 0.5663 0.07 0.440 0.07 21 0.80 0.13 0.4314
M1-M2 on O_SR 0.02 NA 0.38 0.7094 -0.03 0.656 -0.03 24 -0.41 0.05 0.6869
M2-M3 on Y_C -0.02 NA -0.56 0.5790 0.00 0.848 0.00 35 -0.06 0.01 0.9554
M2-M3 on Y_SR 0.06 NA 1.33 0.1986 0.10 0.240 0.10 29 1.34 0.16 0.1913
M2-M3 on O_C -0.01 NA -0.23 0.8169 0.03 0.712 0.03 21 0.35 0.05 0.7316
M2-M3 on O_SR 0.05 NA 0.53 0.6043 -0.01 0.984 -0.01 24 -0.09 0.01 0.9300
M3-M4 on Y_C 0.00 NA -0.12 0.9054 -0.05 0.464 -0.05 35 -0.85 0.09 0.4019
M3-M4 on Y_SR 0.02 NA 0.25 0.8047 -0.03 0.740 -0.03 29 -0.30 0.04 0.7688
M3-M4 on O_C -0.21 NA -2.31 0.0312 -0.26 0.032 -0.26 21 -2.26 0.35 0.0346
M3-M4 on O_SR -0.04 NA -0.65 0.5234 -0.08 0.304 -0.08 24 -0.96 0.12 0.3474
M4-M5 on Y_C 0.05 NA 0.50 0.6254 0.01 0.972 0.03 32 0.34 0.02 0.7371
M4-M5 on Y_SR -0.01 NA -0.09 0.9254 0.02 0.684 0.02 29 0.32 0.04 0.7547
M4-M5 on O_C 0.10 NA 0.96 0.3470 0.12 0.472 0.12 21 0.86 0.16 0.3975
M4-M5 on O_SR 0.25 NA 2.38 0.0271 0.20 0.104 0.20 24 1.85 0.27 0.0772
Simple Effect Age-Sleep on Time=1 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.21 0.648 0.21 0.648 0.11 0.7462 0.6795 0.657 0.05
Sleep 0.01 0.910 0.01 0.910 0.01 0.9208 0.8998 0.900 0.01
Age*Sleep 0.07 0.790 0.01 0.920 0.00 0.9452 0.8581 0.797 0.01
Simple Effect Age-Sleep on Time=1 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.03 55.17 -0.30 0.7673 0.04 0.09 0.7511 0.04
Sleep on Old 0.01 45.00 0.10 0.9203 0.03 0.01 0.9300 0.03
Age on Control -0.05 41.78 -0.56 0.5772 0.08 0.32 0.5711 0.09
Age on SR -0.01 51.48 -0.12 0.9010 0.03 0.02 0.8944 0.04
Simple Effect Age-Sleep on Time=1 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.03 55.17 -0.30 0.7673 0.04 0.09 0.7811 0.04
Sleep on Old 0.01 45.00 0.10 0.9203 0.03 0.01 0.9222 0.03
Age on Control -0.05 41.78 -0.56 0.5772 0.08 0.32 0.5511 0.09
Age on SR -0.01 51.48 -0.12 0.9010 0.04 0.02 0.9111 0.04
YSR vs OC -0.02 48.53 -0.23 0.8160 0.05 0.05 0.8233 0.05
Simple Effect Age-Sleep on Time=2 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.08 0.774 0.08 0.774 0.02 0.8836 0.7880 0.772 0.04
Sleep 2.21 0.141 2.21 0.141 1.06 0.3056 0.1285 0.128 0.16
Age*Sleep 0.01 0.924 -0.01 0.940 0.01 0.9108 0.9499 0.910 0.02
Simple Effect Age-Sleep on Time=2 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.11 60.14 -1.20 0.2342 0.17 1.44 0.2289 0.17
Sleep on Old -0.09 44.99 -0.92 0.3609 0.17 0.85 0.3578 0.17
Age on Control 0.01 46.41 0.14 0.8872 0.05 0.02 0.8878 0.06
Age on SR 0.03 51.33 0.26 0.7959 0.04 0.07 0.7944 0.05
Simple Effect Age-Sleep on Time=2 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young -0.11 60.14 -1.20 0.2342 0.18 1.44 0.2278 0.17
Sleep on Old -0.09 44.99 -0.92 0.3609 0.16 0.85 0.3544 0.15
Age on Control 0.01 46.41 0.14 0.8872 0.05 0.02 0.8789 0.06
Age on SR 0.03 51.33 0.26 0.7959 0.05 0.07 0.7778 0.05
YSR vs OC 0.12 48.17 1.23 0.2243 0.19 1.52 0.2289 0.19
Simple Effect Age-Sleep on Time=3 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.08 0.777 0.08 0.777 0.09 0.7682 0.7746 0.781 0.03
Sleep 0.94 0.335 0.94 0.335 0.31 0.5768 0.3306 0.306 0.09
Age*Sleep 0.91 0.344 -0.07 0.430 0.78 0.3787 0.3756 0.345 0.13
Simple Effect Age-Sleep on Time=3 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.00 59.76 -0.02 0.9879 0.03 0.00 0.9956 0.03
Sleep on Old -0.13 44.95 -1.17 0.2466 0.20 1.38 0.2533 0.20
Age on Control 0.05 38.23 0.49 0.6251 0.07 0.24 0.6178 0.09
Age on SR -0.08 46.23 -0.84 0.4034 0.13 0.71 0.3911 0.14
Simple Effect Age-Sleep on Time=3 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.00 59.76 -0.02 0.9879 0.03 0.00 0.9856 0.03
Sleep on Old -0.13 44.95 -1.17 0.2466 0.19 1.38 0.2400 0.20
Age on Control 0.05 38.23 0.49 0.6251 0.08 0.24 0.6000 0.09
Age on SR -0.08 46.23 -0.84 0.4034 0.13 0.71 0.3967 0.13
YSR vs OC 0.05 42.43 0.48 0.6357 0.09 0.23 0.6211 0.07
Simple Effect Age-Sleep on Time=4 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 3.54 0.063 3.54 0.063 2.35 0.1275 0.0484
0.058 0.20
Sleep 0.18 0.675 0.18 0.675 0.34 0.5602 0.6461 0.682 0.03
Age*Sleep 0.01 0.905 -0.01 0.900 0.00 0.9560 0.8047 0.884 0.01
Simple Effect Age-Sleep on Time=4 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.02 54.48 0.24 0.8141 0.04 0.06 0.8244 0.04
Sleep on Old 0.04 44.83 0.35 0.7270 0.07 0.12 0.7322 0.06
Age on Control -0.16 39.85 -1.52 0.1362 0.23 2.31 0.1556 0.25
Age on SR -0.14 51.84 -1.17 0.2475 0.18 1.37 0.2533 0.19
Simple Effect Age-Sleep on Time=4 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.02 54.48 0.24 0.8141 0.04 0.06 0.7989 0.04
Sleep on Old 0.04 44.83 0.35 0.7270 0.05 0.12 0.7244 0.05
Age on Control -0.16 39.85 -1.52 0.1362 0.21 2.31 0.1589 0.23
Age on SR -0.14 51.84 -1.17 0.2475 0.18 1.37 0.2756 0.18
YSR vs OC -0.18 47.84 -1.53 0.1317 0.24 2.35 0.1378 0.24
Simple Effect Age-Sleep on Time=5 Omnibus AOV. Design 2x2x(5xS)
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.02 0.900 0.02 0.90 0.28 0.5992 NA 1 0.03
Sleep 1.30 0.260 1.30 0.26 2.28 0.1332 NA 0
0.12
Age*Sleep 0.32 0.572 -0.02 0.84 0.29 0.5935 NA 0
0.03
Simple Effect Age-Sleep on Time=5 Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.04 60.73 0.50 0.6160 0.08 0.25 0.6100 0.08
Sleep on Old 0.12 31.06 1.03 0.3087 0.15 1.07 0.3033 0.16
Age on Control -0.05 33.00 -0.42 0.6802 0.08 0.17 0.6944 0.07
Age on SR 0.03 53.00 0.41 0.6868 0.06 0.16 0.6911 0.06
Simple Effect Age-Sleep on Time=5 Extense Simple Effects. Design 2x2x(5xS)
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 0.04 60.73 0.50 0.6160 0.08 0.25 0.6267 0.07
Sleep on Old 0.12 31.06 1.03 0.3087 0.16 1.07 0.2978 0.15
Age on Control -0.05 33.00 -0.42 0.6802 0.07 0.17 0.6844 0.08
Age on SR 0.03 53.00 0.41 0.6868 0.06 0.16 0.6756 0.07
YSR vs OC -0.09 33.21 -0.75 0.4571 0.14 0.57 0.4722 0.13

10.8 Fig S1I Unmoved L-Ratio {Design 2x(5xS)}

  NmBas="FigS1I UnMovedLRatio"
  NmFAlL<-paste0(PathDesign,NmBas)
  if (!dir.exists(NmFAlL)) {dir.create(NmFAlL)}
  NmFAlL<-paste0(NmFAlL,"/")
  ResGen<-NA
    
  rrt<-ExDataIS.3c(nmF = paste0(PathDesign,"ClusterQualityNonMovedControl.csv"),Vars = ,c(4,5,1,11:15),vIntP =c(4:8),lvlCh = list("HAB"="LR_s1", "T1"="LR_s2","T2"="LR_s3","T3"="LR_s4","Test"="LR_s5"))
  DatDT<-rrt$DT
  ArP<-rrt$Arp
  ExtendDT<-rrt$ExtendDT
  
  #Graphs
  Grp<- Grph.3b(DatP = ExtendDT,"OPR",LblsP =c("Cluster Quality", "","L-Ratio"),ylmP =c(0,10),hLin = F,lvIp = 5,GrpSel = c(1,3))

  Grp2=Grp
  
  #AOV
  names(rrt$DT)[3:7]<-c("T1","T2","T3","T4","T5")
  ResGen<-AOVMx2b(A=2,C=5,DatPas = rrt,DatEfSp = DatEfS,nBMM1 = 10000,nBMM2 = 1000,Prc = 2)
  AlmacenGen(GrpP = Grp,Grp2P = Grp2,DataPas = ResGen,PathDesignP = PathDesign,NmBasP = NmBas,Typ=1)
  
   # Other Graphs
    ExtendDTCol<-copy(ExtendDT)
    ExtendDTCol$Moment<-"All"
    ExtendDTCol<-data.table(rbind(ExtendDT,ExtendDTCol))
    
    Grp3<- Grph.3b(DatP = ExtendDTCol,"OPR",LblsP =c("Cluster Quality", "","L-Ratio"),ylmP =c(0,10),hLin = F,lvIp = 6,GrpSel = c(1,3),wMain = T)
    
    ExtendCpy<-copy(ExtendDT)
    names(ExtendCpy)[1]<-"Age"
    GrpO<-Grph.3.Otrosb(ExtendDTp = ExtendCpy,LblsP =c("Cluster Quality", "","L-Ratio"))
    
    pdf(paste0(NmFAlL,NmBas,"OtrosGraphs.pdf"))
      Grp3
      GrpO
    dev.off()

        # Results
        plot(Grp)
        plot(Grp2) # Only this graph is printed in the html file.
        ResGen  # Lean option to view the results of statistical analysis
        
        Kbl3(ResGen[[1]], "Omnibus AOV. Design 2x(5xS)");cat("\n")
        Kbl3(ResGen[[2]], "Simple Effects Age-Time. Design 2x(5xS)")
        Kbl3(ResGen[[3]], "Main Effects of Time. Design 2x(5xS)")
[1] "Taking bootstrap samples. Please wait."
[1] "Taking bootstrap samples. Please wait."
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
$BP

$Bars

$MargAC

$MargC

quartz_off_screen 
                2 
$AOV
       Names    Q      p  pBoot Sig pBootMas Sig2 EffSize
1:       Age 1.14 0.2945 0.3456       0.3018         0.19
2:     Trial 1.86 0.1490 0.1619       0.1724         0.10
3: Age*Trial 0.07 0.9902 0.9900       0.9909         0.03

$InterAC
             Contr psihat    df  test p.value EfSize.V1
 1:      Age on M1  -0.22 22.87 -0.72  0.4798      0.16
 2:      Age on M2  -0.18 22.71 -0.72  0.4800      0.15
 3:      Age on M3  -0.21 19.75 -0.89  0.3856      0.18
 4:      Age on M4  -0.24 25.29 -0.83  0.4119      0.16
 5:      Age on M5  -0.29 30.93 -1.48  0.1499      0.28
 6: M1-M2 on Young   0.01    NA  0.06  0.9559      0.06
 7:   M1-M2 on Old   0.11    NA  0.77  0.4538      0.08
 8: M2-M3 on Young   0.11    NA  1.12  0.2817      0.22
 9:   M2-M3 on Old   0.03    NA  0.20  0.8456      0.10
10: M3-M4 on Young  -0.19    NA -1.48  0.1635      0.20
11:   M3-M4 on Old  -0.10    NA -1.46  0.1678      0.15
12: M4-M5 on Young   0.14    NA  0.58  0.5725      0.09
13:   M4-M5 on Old   0.15    NA  0.77  0.4576      0.06

$DetallMainC
   Contr psihat  test p.value Psihat2 p.value2 EfSize.V1
1: M1-M2   0.08  0.50  0.6243    0.18    0.424      0.06
2: M2-M3   0.16  0.82  0.4260    0.32    0.116      0.16
3: M3-M4  -0.44 -2.94  0.0116   -0.42    0.004      0.17
4: M4-M5   0.26  0.57  0.5754    0.18    0.628      0.07
Omnibus AOV. Design 2x(5xS)
Names Q p pBoot Sig pBootMas Sig2 EffSize
Age 1.14 0.2945 0.3456 0.3018 0.19
Trial 1.86 0.1490 0.1619 0.1724 0.10
Age*Trial 0.07 0.9902 0.9900 0.9909 0.03
Simple Effects Age-Time. Design 2x(5xS)
Contr psihat df test p.value EfSize.V1
Age on M1 -0.22 22.87 -0.72 0.4798 0.16
Age on M2 -0.18 22.71 -0.72 0.4800 0.15
Age on M3 -0.21 19.75 -0.89 0.3856 0.18
Age on M4 -0.24 25.29 -0.83 0.4119 0.16
Age on M5 -0.29 30.93 -1.48 0.1499 0.28
M1-M2 on Young 0.01 NA 0.06 0.9559 0.06
M1-M2 on Old 0.11 NA 0.77 0.4538 0.08
M2-M3 on Young 0.11 NA 1.12 0.2817 0.22
M2-M3 on Old 0.03 NA 0.20 0.8456 0.10
M3-M4 on Young -0.19 NA -1.48 0.1635 0.20
M3-M4 on Old -0.10 NA -1.46 0.1678 0.15
M4-M5 on Young 0.14 NA 0.58 0.5725 0.09
M4-M5 on Old 0.15 NA 0.77 0.4576 0.06
Main Effects of Time. Design 2x(5xS)
Contr psihat test p.value Psihat2 p.value2 EfSize.V1
M1-M2 0.08 0.50 0.6243 0.18 0.424 0.06
M2-M3 0.16 0.82 0.4260 0.32 0.116 0.16
M3-M4 -0.44 -2.94 0.0116 -0.42 0.004 0.17
M4-M5 0.26 0.57 0.5754 0.18 0.628 0.07

11 Supplemental Figure 2. Detection of remapping threshold.


Supplemental Figure 2. Detection of remapping threshold. A-B) Scatter plots showing correlations between Hab/T1 and T1/T2 in young (A) and old (B) animals. Blue ellipse contains correlation values that display high stability on both Hab/T1 and T1/T2, green ellipse contains correlation values that display low stability in Hab/T1 but high stability in T1/T2, red ellipse contains correlation values that display low stability in both Hab/T1 and T1/T2 comparisons. C) Histogram showing cell counts for all correlations. Low stability cells are shown in red, whereas high stability cells are shown in blue. Note that the distributions are not normal, which justified the selection of robust statistics for all the analyses. The threshold of 0.35 best separated stable and unstable correlations. D-E) Results of a machine learning algorithm, MATLAB as kmeans, used to approximate the threshold to determine stability. The algorithm was instructed to group the data into 3 categories using correlation values from young (D) and old (E) mice. Means for each category are indicated by black squares. In both graphs the best approximation coincided with a threshold value of 0.35. These data demonstrate that using scatter plots, histogram distributions, and machine learning algorithms, the threshold of 0.35 is the best value to categorize cell types.


12 Supplemental Figure 3. Bayes classifier validation.


Supplemental Figure 3. Bayes classifier validation. A) Photograph of the SD chamber. B) Representative 5 hr sleep recording showing electroencephalogram (EEG, top panel) and electromyograph (EMG, bottom panel) color-coded using the output of a Bayes classifier. The color-coded EEG and EMG trace illustrates the accuracy of the classifier detecting Wake, NREM and REM periods. C-D) Average normalized confusion matrices for young (C) and old (D) mice. To determine the accuracy, sensitivity and specificity of the classifier, a confusion matrix was created by comparing visual and algorithm scored data in 4 young and 4 old mice. The results of this comparison were summed into the matrix for each animal. Each entry was then divided by the total number of epochs and multiplied by 100 to turn the values into percentages. Average confusion matrices were computed for young (C) and old (D) mice. E) Accuracy of the Bayes classifier for young and old mice. F) Receiver operating characteristic (ROC) curve showing average values of sensitivity (true positive rates) against false positive rates (1-specificity) for Wake, NREM, and REM in young and old mice. The high accuracy of the classifier is illustrated by the fact that all values are plotted in the upper left area, indicating high sensitivity and low fallout errors.


  1. Accuracy of the Bayes classifier for young and old mice
  2. Receiver operating characteristic (ROC) curve
  NmBas="FigS3E_F BayesClassifier"
  NmFich<-paste0(PathDesign,"SensAnalysisAll.csv");
  NmFAlL<-paste0(PathDesign,NmBas)
  if (!dir.exists(NmFAlL)) {dir.create(NmFAlL)}
  NmFAlL<-paste0(NmFAlL,"/")
  ResROC<-list()
  
  DatDTFull <- data.table(read.table(NmFich, header=TRUE, sep=";", na.strings="NA", dec=",",strip.white=TRUE))
  DatDTFull$Label_P<-factor(DatDTFull$Label_P)
  DatDTFull$Label_P<-relevel(DatDTFull$Label_P,"Wake")
  DatDTFull$Label_T<-factor(DatDTFull$Label_T)
  DatDTFull$Label_T<-relevel(DatDTFull$Label_T,"Wake")
  DatDTFull$Group<-factor(DatDTFull$Group)
  DatDTFull$Group<-relevel(DatDTFull$Group,"Young")
  
  SelGrp<-DatDTFull[Group=="Old"&Subject!="TT"]
  SelGrp$Subject<-factor(SelGrp$Subject)
  out1<-lapply(1:4, function(i) {
    SelSbj<-SelGrp[Subject==levels(SelGrp$Subject)[i]]
    xtb<-xtabs(DepVar~Label_P+Label_T,data=SelSbj)
    round(confusionMatrix(xtb, mode="everything")$overall[c(1,2,7)],4)
  })
  out2<-lapply(1:4, function(i) {
    SelSbj<-SelGrp[Subject==levels(SelGrp$Subject)[i]]
    xtb<-xtabs(DepVar~Label_P+Label_T,data=SelSbj)
    round(confusionMatrix(xtb, mode="everything")$byClass,4)
  })
  Rest2<-data.frame("Group"="Old","Subject"=levels(SelGrp$Subject),do.call(rbind,out1))
  ResIntr<-data.frame(matrix(do.call(rbind,out2),nrow=12,byrow=F))
  names(ResIntr)<-labels(out2[[1]])[[2]]
  Rest2.2<-data.frame("Group"="Old","Band"=rep(levels(SelGrp$Label_T),4),"Subject"=rep(levels(SelGrp$Subject),each=3),ResIntr)
  
  SelGrp<-DatDTFull[Group=="Young"&Subject!="TT"]
  SelGrp$Subject<-factor(SelGrp$Subject)
  out1<-lapply(1:4, function(i) {
    SelSbj<-SelGrp[Subject==levels(SelGrp$Subject)[i]]
    xtb<-xtabs(DepVar~Label_P+Label_T,data=SelSbj)
    round(confusionMatrix(xtb, mode="everything")$overall[c(1,2,7)],4)
  })
  out2<-lapply(1:4, function(i) {
    SelSbj<-SelGrp[Subject==levels(SelGrp$Subject)[i]]
    xtb<-xtabs(DepVar~Label_P+Label_T,data=SelSbj)
    round(confusionMatrix(xtb, mode="everything")$byClass,4)
  })
  Rest2b<-data.frame("Group"="Young","Subject"=levels(SelGrp$Subject),do.call(rbind,out1))
  ResIntr<-data.frame(matrix(do.call(rbind,out2),nrow=12,byrow=F))
  names(ResIntr)<-labels(out2[[1]])[[2]]
  Rest2.2b<-data.frame("Group"="Young","Band"=rep(levels(SelGrp$Label_T),4),"Subject"=rep(levels(SelGrp$Subject),each=3),ResIntr)
  
  Rest2f<-  rbind(Rest2b,Rest2)
  Rest2f.2<-  rbind(Rest2.2b,Rest2.2)

  Rest2f$Group<-factor(Rest2f$Group); Rest2f$Group<-relevel(Rest2f$Grou,"Young")
  Rest2f.2$Group<-factor(Rest2f.2$Group); Rest2f.2$Group<-relevel(Rest2f.2$Group,"Young")
  Rest2f.2$Band<- factor(Rest2f.2$Band);  Rest2f.2$Band<- relevel(Rest2f.2$Band,"Wake")
  
  write.csv2(Rest2f,paste0(NmFAlL,NmBas,"ResultSensib1_Acc.csv"))
  write.csv2(Rest2f.2,paste0(NmFAlL,NmBas,"ResultSensib2_ROC.csv"))
  
# Accuracy Graph
  Grp2<-ggplot(Rest2f, aes(x = factor(Group), y = Accuracy)) +
  geom_boxplot(position=position_dodge(0.8),lwd=1)+
  geom_dotplot(binaxis='y', stackdir='center', 
              binpositions="all",dotsize = 1.5) +
     stat_summary(fun.y=mean, geom="point", shape=18,
                 size=10, color="red") + theme_classic2()  +ylim(0.85,1) + labs(x="") +
    theme(legend.position="None", text = element_text(size=28),
    axis.title.x = element_text(color = "black",family="ArialMT",size=28,face="bold"),
    axis.title.y = element_text(color = "black",family="ArialMT",size=28,face="bold"),
    axis.text.x = element_text(color = "black",family="ArialMT",size=20,face="bold"),
    axis.text.y = element_text(color = "black",family="ArialMT",size=20,face="bold")) +
    labs(x="")
  
  pdf(paste0(NmFAlL,NmBas,"_Accuracy.pdf"),family = "ArialMT")
    plot(Grp2)
  dev.off() 
  
# ROC with all data points
  g2<-ggplot(Rest2f.2, aes(x = 1-Specificity, y = Sensitivity,colour=Band,shape=Group))
Grp3<-g2+ geom_point(size=4)  + xlim(0,1) +  ylim(0,1) + geom_abline(intercept = 0,lty=3) +
  theme_linedraw() + theme(legend.position="bottom", text = element_text(size=28),legend.title=element_text(size=12), 
    legend.text=element_text(size=12))

  pdf(paste0(NmFAlL,NmBas,"_SensSpec.pdf"),family = "ArialMT")
    plot(Grp3)
  dev.off() 

# ROC with means
SelGrp<-DatDTFull[Subject=="TT"]
  SelGrp$Subject<-factor(SelGrp$Subject)
   SelGrp$Group<-factor(SelGrp$Group)
out1<-lapply(1:2, function(i) {
    SelSbj<-SelGrp[Group==levels(SelGrp$Group)[i]]
    xtb<-xtabs(DepVar~Label_P+Label_T,data=SelSbj)
    round(confusionMatrix(xtb, mode="everything")$byClass,4)
  })
Restc<-matrix(do.call(rbind,out1),nrow=6,byrow=F)
Rest2c<-data.frame(cbind(rep(levels(SelGrp$Label_T),2),rep(levels(SelGrp$Group),each=3)),Restc)
names(Rest2c)<-c("Band","Group",labels(out1[[1]])[[2]])
Rest2c$Band<-factor(Rest2c$Band)
Rest2c$Band<-relevel(Rest2c$Band,"Wake")
Rest2c$Group<-factor(Rest2c$Group)
Rest2c$Group<-relevel(Rest2c$Group,"Young")

write.csv2(Rest2c,paste0(NmFAlL,NmBas,"ResultSensib3_ROCMeans.csv"))

DTRes<-data.table(Rest2f.2)
   df2<-DTRes[,.(DepVar=Mean_MM(Sensitivity),sem=SEM_MM(Sensitivity)),by=c("Group", "Band")]
   df3<-DTRes[,.(DepVar=Mean_MM(1-Specificity),sem=SEM_MM(1-Specificity)),by=c("Group", "Band")]


ColorEj<-rep(c("brown4","darkgreen","blue4"),2)
g2<-ggplot(Rest2c, aes(x = 1-Specificity, y = Sensitivity,colour=Band,shape=Group))
Grp4<-g2+ geom_point(size=3.5)  + xlim(0,1) +  ylim(0,1) + geom_abline(intercept = 0,lty=3) +
  theme_linedraw() + 
  theme(legend.position="bottom", text = element_text(size=20),legend.title=element_text(size=12), 
    legend.text=element_text(size=12),axis.line = element_line(colour = "black", 
                      size = 1, linetype = "solid"),
           panel.grid = element_line(color = "gray46"),
    plot.margin=unit(c(1.2,1.2,1.2,1.2),"cm"),
    axis.title.x = element_text(color = "black",family="ArialMT",size=28,face="bold"),
    axis.title.y = element_text(color = "black",family="ArialMT",size=28,face="bold"),
    axis.text.x = element_text(color = "black",family="ArialMT",size=20,face="bold"),
    axis.text.y = element_text(color = "black",family="ArialMT",size=20,face="bold")) +
  geom_errorbarh(aes(xmin=1-Rest2c$Specificity-df3$sem, xmax=1-Rest2c$Specificity+df3$sem),
                 size=0.2,color=ColorEj) +
  geom_errorbar(aes(ymin=Rest2c$Sensitivity-df2$sem, ymax=Rest2c$Sensitivity+df2$sem),
                 size=0.2,color=ColorEj) + 
  geom_hline(yintercept=1, size = 1, linetype = "solid") +
  geom_vline(xintercept=1, size = 1, linetype = "solid") +
  scale_x_continuous(expand = c(0, 0), limits = c(0, NA)) + 
  scale_y_continuous(expand = c(0, 0), limits = c(0, NA))

 
  pdf(paste0(NmFAlL,NmBas,"_AllSens.pdf"),family = "ArialMT")
    plot(Grp4)
  dev.off()
  
  # Results
  ResROC$Acc<-Rest2f
  ResROC$ROCAll<-Rest2f.2
  ResROC$ROCMeans<-Rest2c
  
  ResROC$Acc
  ResROC$ROCAll
  ResROC$ROCMeans  
  Kbl3(ResPas = ResROC[[1]], lbl = "Accuracy Analysis")
  Kbl3(ResPas = ResROC[[2]], lbl = "ROC Analysis All Data")
  Kbl3(ResPas = ResROC[[3]], lbl = "ROC Analysis Means")
  
  # Accuracy Graph
    plot(Grp2)
  # ROC with all data points
    plot(Grp3)
  # ROC with means
    plot(Grp4)
quartz_off_screen 
                2 
quartz_off_screen 
                2 
quartz_off_screen 
                2 
  Group     Subject Accuracy  Kappa McnemarPValue
1 Young AT_10_Y_C_P   0.9049 0.8160        0.9984
2 Young AT_15_Y_C_R   0.9331 0.8702        0.9998
3 Young AT_18_Y_D_R   0.9360 0.8859        0.9997
4 Young  MT_7_Y_D_R   0.9051 0.8283        0.9935
5   Old AEG_2_O_D_R   0.9327 0.8896        0.9963
6   Old AT_12_O_D_R   0.9187 0.8324        0.9994
7   Old AT_21_O_C_R   0.8945 0.7986        0.9933
8   Old  MT_0_O_D_R   0.8707 0.7633        0.9998
   Group Band     Subject Sensitivity Specificity Pos.Pred.Value Neg.Pred.Value
1  Young Wake AT_10_Y_C_P      0.7623      0.9789         0.9316         0.9161
2  Young NREM AT_10_Y_C_P      0.9646      0.8690         0.9252         0.9359
3  Young  REM AT_10_Y_C_P      0.9215      0.9657         0.7473         0.9911
4  Young Wake AT_15_Y_C_R      0.9220      0.9814         0.9627         0.9604
5  Young NREM AT_15_Y_C_R      0.9567      0.9190         0.9477         0.9326
6  Young  REM AT_15_Y_C_R      0.7364      0.9761         0.6331         0.9851
7  Young Wake AT_18_Y_D_R      0.9681      0.9559         0.9118         0.9845
8  Young NREM AT_18_Y_D_R      0.9509      0.9592         0.9687         0.9364
9  Young  REM AT_18_Y_D_R      0.7647      0.9815         0.8359         0.9714
10 Young Wake  MT_7_Y_D_R      0.8556      0.9990         0.9975         0.9372
11 Young NREM  MT_7_Y_D_R      0.9226      0.9654         0.9764         0.8892
12 Young  REM  MT_7_Y_D_R      0.9732      0.9128         0.4739         0.9976
13   Old Wake AEG_2_O_D_R      0.8389      0.9953         0.9913         0.9061
14   Old NREM AEG_2_O_D_R      0.9946      0.9956         0.9955         0.9948
15   Old  REM AEG_2_O_D_R      0.9852      0.9293         0.6548         0.9978
16   Old Wake AT_12_O_D_R      0.8506      0.9728         0.8999         0.9578
17   Old NREM AT_12_O_D_R      0.9522      0.9184         0.9610         0.9009
18   Old  REM AT_12_O_D_R      0.8416      0.9623         0.7086         0.9824
19   Old Wake AT_21_O_C_R      0.8015      0.9941         0.9871         0.8993
20   Old NREM AT_21_O_C_R      0.9448      0.8483         0.9002         0.9139
21   Old  REM AT_21_O_C_R      0.9685      0.9582         0.5457         0.9983
22   Old Wake  MT_0_O_D_R      0.7956      0.9179         0.7950         0.9182
23   Old NREM  MT_0_O_D_R      0.9232      0.9236         0.9492         0.8860
24   Old  REM  MT_0_O_D_R      0.7729      0.9545         0.6697         0.9724
   Precision Recall     F1 Prevalence Detection.Rate Detection.Prevalence
1     0.9316 0.7623 0.8385     0.2739         0.2088               0.2241
2     0.9252 0.9646 0.9445     0.6270         0.6048               0.6537
3     0.7473 0.9215 0.8253     0.0991         0.0913               0.1222
4     0.9627 0.9220 0.9419     0.3416         0.3150               0.3272
5     0.9477 0.9567 0.9522     0.6053         0.5791               0.6111
6     0.6331 0.7364 0.6808     0.0531         0.0391               0.0617
7     0.9118 0.9681 0.9391     0.3201         0.3099               0.3399
8     0.9687 0.9509 0.9597     0.5704         0.5424               0.5599
9     0.8359 0.7647 0.7987     0.1095         0.0837               0.1002
10    0.9975 0.8556 0.9211     0.3169         0.2711               0.2718
11    0.9764 0.9226 0.9487     0.6085         0.5614               0.5749
12    0.4739 0.9732 0.6374     0.0746         0.0726               0.1533
13    0.9913 0.8389 0.9087     0.3902         0.3273               0.3302
14    0.9955 0.9946 0.9950     0.4901         0.4874               0.4896
15    0.6548 0.9852 0.7867     0.1198         0.1180               0.1802
16    0.8999 0.8506 0.8745     0.2230         0.1897               0.2108
17    0.9610 0.9522 0.9566     0.6788         0.6463               0.6725
18    0.7086 0.8416 0.7694     0.0982         0.0827               0.1166
19    0.9871 0.8015 0.8847     0.3592         0.2879               0.2917
20    0.9002 0.9448 0.9220     0.5915         0.5589               0.6208
21    0.5457 0.9685 0.6981     0.0493         0.0478               0.0875
22    0.7950 0.7956 0.7953     0.2859         0.2275               0.2861
23    0.9492 0.9232 0.9360     0.6074         0.5608               0.5908
24    0.6697 0.7729 0.7176     0.1066         0.0824               0.1231
   Balanced.Accuracy
1             0.8706
2             0.9168
3             0.9436
4             0.9517
5             0.9378
6             0.8562
7             0.9620
8             0.9550
9             0.8731
10            0.9273
11            0.9440
12            0.9430
13            0.9171
14            0.9951
15            0.9572
16            0.9117
17            0.9353
18            0.9020
19            0.8978
20            0.8966
21            0.9633
22            0.8568
23            0.9234
24            0.8637
  Band Group Sensitivity Specificity Pos Pred Value Neg Pred Value Precision
1 Wake Young      0.8820      0.9788         0.9500         0.9479    0.9500
2 NREM Young      0.9488      0.9295         0.9533         0.9228    0.9533
3  REM Young      0.8527      0.9589         0.6556         0.9861    0.6556
4 Wake   Old      0.8205      0.9685         0.9227         0.9216    0.9227
5 NREM   Old      0.9517      0.9262         0.9493         0.9296    0.9493
6  REM   Old      0.8847      0.9513         0.6519         0.9877    0.6519
  Recall     F1 Prevalence Detection Rate Detection Prevalence
1 0.8820 0.9147     0.3131         0.2762               0.2907
2 0.9488 0.9510     0.6028         0.5719               0.5999
3 0.8527 0.7413     0.0841         0.0717               0.1094
4 0.8205 0.8686     0.3146         0.2581               0.2797
5 0.9517 0.9505     0.5919         0.5633               0.5934
6 0.8847 0.7507     0.0935         0.0827               0.1269
  Balanced Accuracy
1            0.9304
2            0.9392
3            0.9058
4            0.8945
5            0.9390
6            0.9180
Accuracy Analysis
Group Subject Accuracy Kappa McnemarPValue
Young AT_10_Y_C_P 0.9049 0.8160 0.9984
Young AT_15_Y_C_R 0.9331 0.8702 0.9998
Young AT_18_Y_D_R 0.9360 0.8859 0.9997
Young MT_7_Y_D_R 0.9051 0.8283 0.9935
Old AEG_2_O_D_R 0.9327 0.8896 0.9963
Old AT_12_O_D_R 0.9187 0.8324 0.9994
Old AT_21_O_C_R 0.8945 0.7986 0.9933
Old MT_0_O_D_R 0.8707 0.7633 0.9998
ROC Analysis All Data
Group Band Subject Sensitivity Specificity Pos.Pred.Value Neg.Pred.Value Precision Recall F1 Prevalence Detection.Rate Detection.Prevalence Balanced.Accuracy
Young Wake AT_10_Y_C_P 0.7623 0.9789 0.9316 0.9161 0.9316 0.7623 0.8385 0.2739 0.2088 0.2241 0.8706
Young NREM AT_10_Y_C_P 0.9646 0.8690 0.9252 0.9359 0.9252 0.9646 0.9445 0.6270 0.6048 0.6537 0.9168
Young REM AT_10_Y_C_P 0.9215 0.9657 0.7473 0.9911 0.7473 0.9215 0.8253 0.0991 0.0913 0.1222 0.9436
Young Wake AT_15_Y_C_R 0.9220 0.9814 0.9627 0.9604 0.9627 0.9220 0.9419 0.3416 0.3150 0.3272 0.9517
Young NREM AT_15_Y_C_R 0.9567 0.9190 0.9477 0.9326 0.9477 0.9567 0.9522 0.6053 0.5791 0.6111 0.9378
Young REM AT_15_Y_C_R 0.7364 0.9761 0.6331 0.9851 0.6331 0.7364 0.6808 0.0531 0.0391 0.0617 0.8562
Young Wake AT_18_Y_D_R 0.9681 0.9559 0.9118 0.9845 0.9118 0.9681 0.9391 0.3201 0.3099 0.3399 0.9620
Young NREM AT_18_Y_D_R 0.9509 0.9592 0.9687 0.9364 0.9687 0.9509 0.9597 0.5704 0.5424 0.5599 0.9550
Young REM AT_18_Y_D_R 0.7647 0.9815 0.8359 0.9714 0.8359 0.7647 0.7987 0.1095 0.0837 0.1002 0.8731
Young Wake MT_7_Y_D_R 0.8556 0.9990 0.9975 0.9372 0.9975 0.8556 0.9211 0.3169 0.2711 0.2718 0.9273
Young NREM MT_7_Y_D_R 0.9226 0.9654 0.9764 0.8892 0.9764 0.9226 0.9487 0.6085 0.5614 0.5749 0.9440
Young REM MT_7_Y_D_R 0.9732 0.9128 0.4739 0.9976 0.4739 0.9732 0.6374 0.0746 0.0726 0.1533 0.9430
Old Wake AEG_2_O_D_R 0.8389 0.9953 0.9913 0.9061 0.9913 0.8389 0.9087 0.3902 0.3273 0.3302 0.9171
Old NREM AEG_2_O_D_R 0.9946 0.9956 0.9955 0.9948 0.9955 0.9946 0.9950 0.4901 0.4874 0.4896 0.9951
Old REM AEG_2_O_D_R 0.9852 0.9293 0.6548 0.9978 0.6548 0.9852 0.7867 0.1198 0.1180 0.1802 0.9572
Old Wake AT_12_O_D_R 0.8506 0.9728 0.8999 0.9578 0.8999 0.8506 0.8745 0.2230 0.1897 0.2108 0.9117
Old NREM AT_12_O_D_R 0.9522 0.9184 0.9610 0.9009 0.9610 0.9522 0.9566 0.6788 0.6463 0.6725 0.9353
Old REM AT_12_O_D_R 0.8416 0.9623 0.7086 0.9824 0.7086 0.8416 0.7694 0.0982 0.0827 0.1166 0.9020
Old Wake AT_21_O_C_R 0.8015 0.9941 0.9871 0.8993 0.9871 0.8015 0.8847 0.3592 0.2879 0.2917 0.8978
Old NREM AT_21_O_C_R 0.9448 0.8483 0.9002 0.9139 0.9002 0.9448 0.9220 0.5915 0.5589 0.6208 0.8966
Old REM AT_21_O_C_R 0.9685 0.9582 0.5457 0.9983 0.5457 0.9685 0.6981 0.0493 0.0478 0.0875 0.9633
Old Wake MT_0_O_D_R 0.7956 0.9179 0.7950 0.9182 0.7950 0.7956 0.7953 0.2859 0.2275 0.2861 0.8568
Old NREM MT_0_O_D_R 0.9232 0.9236 0.9492 0.8860 0.9492 0.9232 0.9360 0.6074 0.5608 0.5908 0.9234
Old REM MT_0_O_D_R 0.7729 0.9545 0.6697 0.9724 0.6697 0.7729 0.7176 0.1066 0.0824 0.1231 0.8637
ROC Analysis Means
Band Group Sensitivity Specificity Pos Pred Value Neg Pred Value Precision Recall F1 Prevalence Detection Rate Detection Prevalence Balanced Accuracy
Wake Young 0.8820 0.9788 0.9500 0.9479 0.9500 0.8820 0.9147 0.3131 0.2762 0.2907 0.9304
NREM Young 0.9488 0.9295 0.9533 0.9228 0.9533 0.9488 0.9510 0.6028 0.5719 0.5999 0.9392
REM Young 0.8527 0.9589 0.6556 0.9861 0.6556 0.8527 0.7413 0.0841 0.0717 0.1094 0.9058
Wake Old 0.8205 0.9685 0.9227 0.9216 0.9227 0.8205 0.8686 0.3146 0.2581 0.2797 0.8945
NREM Old 0.9517 0.9262 0.9493 0.9296 0.9493 0.9517 0.9505 0.5919 0.5633 0.5934 0.9390
REM Old 0.8847 0.9513 0.6519 0.9877 0.6519 0.8847 0.7507 0.0935 0.0827 0.1269 0.9180

13 Supplemental Figure 4. Power spectra during NREM and REM.


Supplemental Figure 4. Power spectra during NREM and REM during post-learning and recovery and relative sigma (RSP) and beta (RBP) power. A-F) NREM and REM average (red) and individual (gray) power spectra during post-learning (A-B) and recovery (C-F) for all age groups and sleep conditions. G-J) RSP and RBP did not show differences during post-learning (G-H) or recovery (I-J). Statistical details in Supplemental Statistical Table corresponding to Supplemental Figure 4.


13.1 Fig S4G,H Band Power PostL {Design 2}

  NmBas="FigS4G_H Band Power PostL"
  NmFich="BandPowerPostL.csv";
  NmFich<-paste0(PathDesign,NmFich);
  NmFAlL<-paste0(PathDesign,NmBas)
  if (!dir.exists(NmFAlL)) {dir.create(NmFAlL)}
  NmFAlL<-paste0(NmFAlL,"/")
  DatDTFull <- data.table(read.table(NmFich, header=TRUE, sep=";", na.strings="NA", dec=",",strip.white=TRUE))
  DatDT<-DatDTFull
  DatDT$Group<-factor(DatDT$Group);DatDT$Group<-relevel(DatDT$Group,"Young_C")
  ResFn<-ResAOV1<-list()
  i=1
  for (i in 1:5) {
    DepVar<-names(DatDTFull)[8+i]
    YuenRes<-WRS2::yuen(get(DepVar)~Group,DatDT)
    ResFnPrv<-data.table(with(YuenRes,
                              cbind(DepV=DepVar,diff=round(diff,2),df=round(df,2),test=round(test,2),
                                    EffSize=round(effsize,2),p=round(p.value,4))))
    ResFn<-rbind(ResFn,ResFnPrv)
    lvs<-c(4,7,8+i)
    DatDTG<-DatDTFull[,..lvs];
    DatDTG$Age<-factor(DatDTG$Age)
    DatDTG$Age<-relevel(DatDTG$Age,"Young")
    setkey(DatDTG,Age)

    ArPGlobal<-c(lapply(1:2, function (x) DatDTG[.(levels(DatDTG$Age)[x]),3,with=F][[1]]),recursive = F)
    ResAOV1[[i]]<-AOVSingle(ArPGlobal,2)
  }
  rbResRb22<-data.table(Vars=names(DatDTFull)[9:13],do.call(rbind, lapply(ResAOV1, as.data.table)))
  
  GrpF<-list()
  DepVar1<-names(DatDTFull)[8+1]
  GrpF$A<- Grph.1(DatDT,DepVar1,LblsP =c("Preference for Displaced Object", "","Relative Delta Power"),c(0,50),F,GrpSel=c(1,3))
  DepVar2<-names(DatDTFull)[8+2]
  GrpF$B<- Grph.1(DatDT,DepVar2,LblsP =c("Preference for Displaced Object", "","Relative Sigma Power"),c(0,50),F,GrpSel=c(1,3))
  DepVar3<-names(DatDTFull)[8+3]
  GrpF$C<- Grph.1(DatDT,DepVar3,LblsP =c("Preference for Displaced Object", "","Relative Theta Power"),c(0,100),F,GrpSel=c(1,3))
  DepVar4<-names(DatDTFull)[8+4]
  GrpF$D<- Grph.1(DatDT,DepVar4,LblsP =c("Preference for Displaced Object", "","Relative Beta Power"),c(0,50),F,GrpSel=c(1,3))
  DepVar5<-names(DatDTFull)[8+5]
  GrpF$E<- Grph.1(DatDT,DepVar5,LblsP =c("Preference for Displaced Object", "",DepVar5),c(300,320),F,GrpSel=c(1,3))
  
  ResRes<-list()
  #ResRes[[1]]<-ResFn
  ResRes[[1]]<-rbResRb22
  AlmacenGen3(GrpP = GrpF,DataPas = ResRes,PathDesignP = PathDesign,NmBasP = NmBas, Typ=1)
  
  NmBas2="FigS4G RelSigmaPower PostL"
  pdf(paste0(NmFAlL,NmBas2,".pdf"))
     GrpF$B
  dev.off()
  NmBas3="FigS4H RelBetaaPower PostL"
  pdf(paste0(NmFAlL,NmBas3,".pdf"))
     GrpF$D
  dev.off()
    
  pdf(paste0(NmFAlL,NmBas,"TodosGraphs.pdf"))
     GrpF
  dev.off()
  
  # All
  rrt<-ExDataIS.3c(nmF = paste0(PathDesign,"BandPowerPostL.csv"),Vars = c(4,5,7,9:12),vIntP =c(4:7),lvlCh = list("Delta"="delta_NREM", "Sigma"="sigma_NREM","Theta"="theta_REM","Beta"="beta_REM"))
  
  GrpF2<-list()
  GrpF2<-Grph.3b(rrt$ExtendDT,"Moment",LblsP =c("Preference for Unmoved Objects", "","Relative Power"),c(0,100),GrpSel = c(1,3),F)
  
  pdf(paste0(NmFAlL,NmBas,"TodosGraphs.pdf"))
     GrpF2
    dev.off()
    
    #Results
    print("FigS4G RelSigmaPower PostL")
    plot(GrpF$B)
    print("FigS4H RelBetaaPower PostL")
    plot(GrpF$D)
    ResRes
    
    Kbl3(ResRes, "Omnibus AOV. Design 2")
quartz_off_screen 
                2 
quartz_off_screen 
                2 
$A

$B

$C

$D

$E

quartz_off_screen 
                2 
quartz_off_screen 
                2 
[1] "FigS4G RelSigmaPower PostL"
[1] "FigS4H RelBetaaPower PostL"
[[1]]
           Vars                                                         t
1:   delta_NREM Diff = -4.17, V(9.63) = 0.87, Eff.Size = 0.26, p = 0.4057
2:   sigma_NREM  Diff = 2.77, V(8.18) = 1.77, Eff.Size = 0.64, p = 0.1147
3:    theta_REM  Diff = 7.97, V(5.59) = 1.02, Eff.Size = 0.49, p = 0.3495
4:     beta_REM   Diff = 1.27, V(8.71) = 0.9, Eff.Size = 0.27, p = 0.3939
5: totalPercent Diff = 1.24, V(10.98) = 1.89, Eff.Size = 0.54, p = 0.0852
                                                            tRk1 t.2.Diff
1: Diff = -4.17, Fw(1,13.46) = 0.56, Eff.Size = 0.26, p = 0.4665    -4.17
2:  Diff = 2.77, Fw(1,14.49) = 1.35, Eff.Size = 0.64, p = 0.2635     2.77
3:   Diff = 7.97, Fw(1,12.89) = 0.56, Eff.Size = 0.49, p = 0.469     7.97
4:  Diff = 1.27, Fw(1,11.05) = 1.06, Eff.Size = 0.27, p = 0.3247     1.27
5:   Diff = 1.24, Fw(1,14.3) = 2.34, Eff.Size = 0.54, p = 0.1476     1.24
   t.2.DF t.2.FW t.2.Ef.Size  t.2.p tRk2.Diff tRk2.DF1 tRk2.DF2 tRk2.Fw
1:   9.63   0.87        0.26 0.4057     -4.17        1    13.46    0.56
2:   8.18   1.77        0.64 0.1147      2.77        1    14.49    1.35
3:   5.59   1.02        0.49 0.3495      7.97        1    12.89    0.56
4:   8.71   0.90        0.27 0.3939      1.27        1    11.05    1.06
5:  10.98   1.89        0.54 0.0852      1.24        1    14.30    2.34
   tRk2.Ef.Size tRk2.p
1:         0.26 0.4665
2:         0.64 0.2635
3:         0.49 0.4690
4:         0.27 0.3247
5:         0.54 0.1476
Omnibus AOV. Design 2
Vars t tRk1 t.2.Diff t.2.DF t.2.FW t.2.Ef.Size t.2.p tRk2.Diff tRk2.DF1 tRk2.DF2 tRk2.Fw tRk2.Ef.Size tRk2.p
delta_NREM Diff = -4.17, V(9.63) = 0.87, Eff.Size = 0.26, p = 0.4057 Diff = -4.17, Fw(1,13.46) = 0.56, Eff.Size = 0.26, p = 0.4665 -4.17 9.63 0.87 0.26 0.4057 -4.17 1 13.46 0.56 0.26 0.4665
sigma_NREM Diff = 2.77, V(8.18) = 1.77, Eff.Size = 0.64, p = 0.1147 Diff = 2.77, Fw(1,14.49) = 1.35, Eff.Size = 0.64, p = 0.2635 2.77 8.18 1.77 0.64 0.1147 2.77 1 14.49 1.35 0.64 0.2635
theta_REM Diff = 7.97, V(5.59) = 1.02, Eff.Size = 0.49, p = 0.3495 Diff = 7.97, Fw(1,12.89) = 0.56, Eff.Size = 0.49, p = 0.469 7.97 5.59 1.02 0.49 0.3495 7.97 1 12.89 0.56 0.49 0.4690
beta_REM Diff = 1.27, V(8.71) = 0.9, Eff.Size = 0.27, p = 0.3939 Diff = 1.27, Fw(1,11.05) = 1.06, Eff.Size = 0.27, p = 0.3247 1.27 8.71 0.90 0.27 0.3939 1.27 1 11.05 1.06 0.27 0.3247
totalPercent Diff = 1.24, V(10.98) = 1.89, Eff.Size = 0.54, p = 0.0852 Diff = 1.24, Fw(1,14.3) = 2.34, Eff.Size = 0.54, p = 0.1476 1.24 10.98 1.89 0.54 0.0852 1.24 1 14.30 2.34 0.54 0.1476

13.2 Fig S4I,J Band Power Recover {Design 2*2}

  NmBas="FigS4I RelSigmaPowerNREM Recover"
  rrt<-ExData.2(nmF = paste0(PathDesign,"BandPowerRecover.csv"),Vars = c(4:5,10))
  DatDT<-rrt$DT
  ArP<-rrt$Arp
  
  #Graphs
  Grp<- Grph.2(DatDT,"sigma_NREM",LblsP =c("Preference for Unmoved Objects", "","Relative Sigma Power"),c(0,30),F)
  Grp2<- Grp 
  # AOV & Simple Effects
  ResGen<-NA
  names(rrt$DT)[3]<-"DepV"
  ResGen<-AOVBwF(2,2,DatPas = rrt,nBMM = 10000)
  AlmacenGen(GrpP = Grp,Grp2P = Grp2,DataPas = ResGen,PathDesignP = PathDesign,NmBasP = NmBas,Typ=1)
  
  #Results FigS4I RelSigmaPowerNREM Recover
        # Results
        plot(Grp)
        plot(Grp2) # Only this graph is printed in the html file.
        ResGen  # Lean option to view the results of statistical analysis
        
        Kbl3(ResGen[[1]], "Omnibus AOV. Design 2x2");cat("\n")
        Kbl3(ResGen[[2]], "Simple Effects Age-Sleep. Design 2x2")
        Kbl3(ResGen[[3]], "Extense Simple Effects Age-Sleep. Design 2x2")
  
NmBas="FigS4J RelBetaPowerREM Recover"
  rrt<-ExData.2(nmF = paste0(PathDesign,"BandPowerRecover.csv"),Vars = c(4:5,11))
  DatDT<-rrt$DT
  ArP<-rrt$Arp  
  
  #Graphs
  Grp<- Grph.2(DatDT,"theta_REM",LblsP =c("Preference for Unmoved Objects", "","Relative Theta Power"),c(0,100),F)
  Grp2=Grp
  
  # AOV & Simple Effects
  ResGen<-NA
  names(rrt$DT)[3]<-"DepV"
  ResGen<-AOVBwF(2,2,DatPas = rrt,nBMM = 10000)
  AlmacenGen(Grp,Grp2,ResGen,PathDesign,NmBas,Typ=1)
  
  #Results FigS4J RelBetaPowerREM Recove
        # Results
        plot(Grp)
        plot(Grp2) # Only this graph is printed in the html file.
        ResGen  # Lean option to view the results of statistical analysis
        
        Kbl3(ResGen[[1]], "Omnibus AOV. Design 2x2");cat("\n")
        Kbl3(ResGen[[2]], "Simple Effects Age-Sleep. Design 2x2")
        Kbl3(ResGen[[3]], "Extense Simple Effects Age-Sleep. Design 2x2")
  
# All
  rrt<-ExDataIS.2(nmF = paste0(PathDesign,"BandPowerRecover.csv"),Vars = c(4,5,7,9:12),vIntP =c(4:7),
                  lvlCh = list("Delta"="delta_NREM", "Sigma"="sigma_NREM","Theta"="theta_REM","Beta"="beta_REM"))
  GrpF<-Grph.3(rrt$ExtendDT,"Moment",LblsP =c("Preference for Unmoved Objects", "","Relative Power"),c(0,100),F)
  NmBas="FigBP_Band Power Recover All Bands"
  NmFAlL<-paste0(PathDesign,NmBas)
  if (!dir.exists(NmFAlL)) {dir.create(NmFAlL)}
  NmFAlL<-paste0(NmFAlL,"/")
    
  pdf(paste0(NmFAlL,NmBas,"TodosGraphs.pdf"))
     GrpF
  dev.off()
[1] "Taking bootstrap samples. Please wait."
          Eff   p.V1 p.Sig
1:  A.p.value 0.5142      
2:  B.p.value 0.3122      
3: AB.p.value 0.8932      
[1] "Taking bootstrap samples. Please wait."
          Eff   p.V1 p.Sig
1:  A.p.value 0.5004      
2:  B.p.value 0.3227      
3: AB.p.value 0.8553      
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 0.52 0.484   0.52  0.484  1.01 0.3226 0.5142       0.5004       
2:     Sleep 1.06 0.320   1.06  0.320  1.33 0.2584 0.3122       0.3227       
3: Age*Sleep 0.04 0.848   0.01  0.970  0.02 0.8844 0.8932       0.8553       
   EffSize
1:    0.24
2:    0.31
3:    0.06

$Detall
            Contr psihat    df test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   1.19 11.93 0.81  0.4332      0.30      0.66 0.4478
2:   Sleep on Old   1.74  7.90 0.72  0.4950      0.27      0.51 0.5289
3: Age on Control   0.74  7.45 0.31  0.7638      0.13      0.10 0.7967
4:      Age on SR   1.30 11.68 0.84  0.4160      0.17      0.71 0.4222
   EffSize.Boot
1:         0.30
2:         0.30
3:         0.13
4:         0.17

$DetallExt
            Contr psihat    df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young   1.19 11.93  0.81  0.4332      0.30      0.66 0.4433
2:   Sleep on Old   1.74  7.90  0.72  0.4950      0.30      0.51 0.5167
3: Age on Control   0.74  7.45  0.31  0.7638      0.14      0.10 0.7744
4:      Age on SR   1.30 11.68  0.84  0.4160      0.18      0.71 0.4178
5:      YSR vs OC  -0.44  7.13 -0.19  0.8560      0.11      0.04 0.8744
   EffSize.Boot
1:         0.30
2:         0.30
3:         0.13
4:         0.18
5:         0.12
Omnibus AOV. Design 2x2
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.52 0.484 0.52 0.484 1.01 0.3226 0.5142 0.5004 0.24
Sleep 1.06 0.320 1.06 0.320 1.33 0.2584 0.3122 0.3227 0.31
Age*Sleep 0.04 0.848 0.01 0.970 0.02 0.8844 0.8932 0.8553 0.06
Simple Effects Age-Sleep. Design 2x2
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 1.19 11.93 0.81 0.4332 0.30 0.66 0.4478 0.30
Sleep on Old 1.74 7.90 0.72 0.4950 0.27 0.51 0.5289 0.30
Age on Control 0.74 7.45 0.31 0.7638 0.13 0.10 0.7967 0.13
Age on SR 1.30 11.68 0.84 0.4160 0.17 0.71 0.4222 0.17
Extense Simple Effects Age-Sleep. Design 2x2
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 1.19 11.93 0.81 0.4332 0.30 0.66 0.4433 0.30
Sleep on Old 1.74 7.90 0.72 0.4950 0.30 0.51 0.5167 0.30
Age on Control 0.74 7.45 0.31 0.7638 0.14 0.10 0.7744 0.13
Age on SR 1.30 11.68 0.84 0.4160 0.18 0.71 0.4178 0.18
YSR vs OC -0.44 7.13 -0.19 0.8560 0.11 0.04 0.8744 0.12
[1] "Taking bootstrap samples. Please wait."
          Eff   p.V1 p.Sig
1:  A.p.value 0.6561      
2:  B.p.value 0.5977      
3: AB.p.value 0.3105      
[1] "Taking bootstrap samples. Please wait."
          Eff   p.V1 p.Sig
1:  A.p.value 0.6238      
2:  B.p.value 0.5965      
3: AB.p.value 0.1649      
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
[1] "Note: confidence intervals are adjusted to control FWE"
[1] "But p-values are not adjusted to control FWE"
[1] "Adjusted p-values can be computed with the R function p.adjust"
$AOV
       Names    Q     p Q.RMul p.RMul F.Rk1  p.Rk1  pBoot Sig pBootMas SigMas
1:       Age 0.26 0.620   0.26  0.620  0.35 0.5611 0.6561       0.6238       
2:     Sleep 0.30 0.594   0.30  0.594  0.49 0.4921 0.5977       0.5965       
3: Age*Sleep 2.25 0.158  -0.33  0.100  2.37 0.1355 0.3105       0.1649       
   EffSize
1:    0.18
2:    0.20
3:    0.60

$Detall
            Contr psihat   df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  10.15 7.24  1.73  0.1256      0.66      3.00 0.1244
2:   Sleep on Old  -4.71 6.45 -0.59  0.5757      0.31      0.35 0.6018
3: Age on Control   4.91 5.59  0.64  0.5483      0.38      0.41 0.6067
4:      Age on SR  -9.96 8.94 -1.59  0.1469      0.57      2.52 0.1900
   EffSize.Boot
1:         0.66
2:         0.31
3:         0.43
4:         0.54

$DetallExt
            Contr psihat   df  test p.value EfSize.V1 Test.Boot p.Boot
1: Sleep on Young  10.15 7.24  1.73  0.1256      0.66      3.00 0.1133
2:   Sleep on Old  -4.71 6.45 -0.59  0.5757      0.33      0.35 0.6256
3: Age on Control   4.91 5.59  0.64  0.5483      0.29      0.41 0.5956
4:      Age on SR  -9.96 8.94 -1.59  0.1469      0.55      2.52 0.1533
5:      YSR vs OC  -5.24 9.64 -0.56  0.5868      0.18      0.32 0.6022
   EffSize.Boot
1:         0.66
2:         0.31
3:         0.31
4:         0.57
5:         0.21
Omnibus AOV. Design 2x2
Names Q p Q.RMul p.RMul F.Rk1 p.Rk1 pBoot Sig pBootMas SigMas EffSize
Age 0.26 0.620 0.26 0.620 0.35 0.5611 0.6561 0.6238 0.18
Sleep 0.30 0.594 0.30 0.594 0.49 0.4921 0.5977 0.5965 0.20
Age*Sleep 2.25 0.158 -0.33 0.100 2.37 0.1355 0.3105 0.1649 0.60
Simple Effects Age-Sleep. Design 2x2
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 10.15 7.24 1.73 0.1256 0.66 3.00 0.1244 0.66
Sleep on Old -4.71 6.45 -0.59 0.5757 0.31 0.35 0.6018 0.31
Age on Control 4.91 5.59 0.64 0.5483 0.38 0.41 0.6067 0.43
Age on SR -9.96 8.94 -1.59 0.1469 0.57 2.52 0.1900 0.54
Extense Simple Effects Age-Sleep. Design 2x2
Contr psihat df test p.value EfSize.V1 Test.Boot p.Boot EffSize.Boot
Sleep on Young 10.15 7.24 1.73 0.1256 0.66 3.00 0.1133 0.66
Sleep on Old -4.71 6.45 -0.59 0.5757 0.33 0.35 0.6256 0.31
Age on Control 4.91 5.59 0.64 0.5483 0.29 0.41 0.5956 0.31
Age on SR -9.96 8.94 -1.59 0.1469 0.55 2.52 0.1533 0.57
YSR vs OC -5.24 9.64 -0.56 0.5868 0.18 0.32 0.6022 0.21
quartz_off_screen 
                2